/* Free any memory in @free but not in @dont.  */
static void kvm_free_physmem_slot(struct kvm_memory_slot *free, struct kvm_memory_slot *dont)
/* Free any memory in @free but not in @dont.  */
static void kvm_free_physmem_slot(struct kvm_memory_slot *free, struct kvm_memory_slot *dont)
{
	int i;
	if (!dont || free->rmap != dont->rmap)
		vfree(free->rmap);
	if (!dont || free->dirty_bitmap != dont->dirty_bitmap)
		vfree(free->dirty_bitmap);
	for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) {
		if (!dont || free->lpage_info[i] != dont->lpage_info[i]) {
			vfree(free->lpage_info[i]);
			free->lpage_info[i] = NULL;
		}
	}
	free->npages = 0;
	free->dirty_bitmap = NULL;
	free->rmap = NULL;
}