Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356785
b: refs/heads/master
c: 9c695d4
h: refs/heads/master
i:
  356783: 3df1df6
v: v3
  • Loading branch information
Alex Williamson authored and Marcelo Tosatti committed Dec 14, 2012
1 parent 1f979a2 commit b31180d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: f0736cf0550b349a5d5a374d65ca0488cc2eee40
refs/heads/master: 9c695d42dbd465bcaa865603b411a73c60e60978
8 changes: 7 additions & 1 deletion trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,13 +784,19 @@ int __kvm_set_memory_region(struct kvm *kvm,

r = -ENOMEM;

/* Allocate if a slot is being created */
/*
* Allocate if a slot is being created. If modifying a slot,
* the userspace_addr cannot change.
*/
if (!old.npages) {
new.user_alloc = user_alloc;
new.userspace_addr = mem->userspace_addr;

if (kvm_arch_create_memslot(&new, npages))
goto out_free;
} else if (npages && mem->userspace_addr != old.userspace_addr) {
r = -EINVAL;
goto out_free;
}

/* Allocate page dirty bitmap if needed */
Expand Down

0 comments on commit b31180d

Please sign in to comment.