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 <[email protected]>
---
Paolo,

This is just a small cleanup to follow-up commit, efbeec7098ee, "fix
sorting of memslots with base_gfn == 0".

Tiejun

 virt/kvm/kvm_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 1cc6e2e..369c759 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -673,6 +673,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 {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to