kvm: update_memslots: clean flags for invalid memslots
authorTiejun Chen <tiejun.chen@intel.com>
Fri, 9 Jan 2015 08:29:14 +0000 (16:29 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Jan 2015 20:31:44 +0000 (21:31 +0100)
Indeed, any invalid memslots should be new->npages = 0,
new->base_gfn = 0 and new->flags = 0 at the same time.

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c

index 246cf291c6fd6a16fb38fc18f8f990720aff1e8d..a8490f08448396f997231c9c0f426fd1ca062527 100644 (file)
@@ -675,6 +675,7 @@ static void update_memslots(struct kvm_memslots *slots,
        if (!new->npages) {
                WARN_ON(!mslots[i].npages);
                new->base_gfn = 0;
+               new->flags = 0;
                if (mslots[i].npages)
                        slots->used_slots--;
        } else {