On Thu, Nov 20, 2008 at 01:02:39PM +0200, Avi Kivity wrote: > Anthony Liguori wrote: >> >> That's not how I read the code. I see: >> >>> >>> static void kvm_free_physmem_slot(struct kvm_memory_slot *free, >>> struct kvm_memory_slot *dont) >>> { >>> if (!dont || free->rmap != dont->rmap) >>> vfree(free->rmap); >> >> And it's called as kvm_free_physmem_slot(&old, &new); >> >> new is assigned to old to start out with so old.rmap will equal new.rmap. >> > > Hm, if !npages we should just kvm_free_physmem_slot(&old, NULL). Actually, I believe we need a little bit more than that, because we can have valid rmaps in flight. Tell me what you think about this.