]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Fix user memslot overlap check
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 29 Nov 2012 21:07:59 +0000 (14:07 -0700)
committerMarcelo Tosatti <mtosatti@redhat.com>
Fri, 30 Nov 2012 01:30:32 +0000 (23:30 -0200)
commit486a0506f0f910a6bb55e3e4a944773635a9d6f6
tree723920e638aa5adadf5252121b7126e1ad125a44
parent781d8f472d6199ec3a66ff0270f3c85f830fe0c8
KVM: Fix user memslot overlap check

Prior to memory slot sorting this loop compared all of the user memory
slots for overlap with new entries.  With memory slot sorting, we're
just checking some number of entries in the array that may or may not
be user slots.  Instead, walk all the slots with kvm_for_each_memslot,
which has the added benefit of terminating early when we hit the first
empty slot, and skip comparison to private slots.

Cc: stable@vger.kernel.org
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
virt/kvm/kvm_main.c