Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343551
b: refs/heads/master
c: 5419369
h: refs/heads/master
i:
  343549: b1397e7
  343547: 2398588
  343543: e052b94
  343535: 01139a7
  343519: bf79374
  343487: f1cce6d
  343423: 2d9d1ee
  343295: 2603108
  343039: 3256d75
v: v3
  • Loading branch information
Alex Williamson authored and Marcelo Tosatti committed Nov 30, 2012
1 parent 6ed7abd commit ce28f3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a560f8b5ed361c7be783d5a671ea26ca4d6fa01
refs/heads/master: 5419369ed6bd4cf711fdda5e52a5999b940413f5
13 changes: 5 additions & 8 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
int r;
gfn_t base_gfn;
unsigned long npages;
unsigned long i;
struct kvm_memory_slot *memslot;
struct kvm_memory_slot *memslot, *slot;
struct kvm_memory_slot old, new;
struct kvm_memslots *slots, *old_memslots;

Expand Down Expand Up @@ -766,13 +765,11 @@ int __kvm_set_memory_region(struct kvm *kvm,

/* Check for overlaps */
r = -EEXIST;
for (i = 0; i < KVM_MEMORY_SLOTS; ++i) {
struct kvm_memory_slot *s = &kvm->memslots->memslots[i];

if (s == memslot || !s->npages)
kvm_for_each_memslot(slot, kvm->memslots) {
if (slot->id >= KVM_MEMORY_SLOTS || slot == memslot)
continue;
if (!((base_gfn + npages <= s->base_gfn) ||
(base_gfn >= s->base_gfn + s->npages)))
if (!((base_gfn + npages <= slot->base_gfn) ||
(base_gfn >= slot->base_gfn + slot->npages)))
goto out_free;
}

Expand Down

0 comments on commit ce28f3c

Please sign in to comment.