KVM: set_memory_region: Refactor prepare_memory_region()

This patch drops the parameter old, a copy of the old memory slot, and
adds a new parameter named change to know the change being requested.

This not only cleans up the code but also removes extra copying of the
memory slot structure.

Signed-off-by: Takuya Yoshikawa <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
This commit is contained in:
Takuya Yoshikawa 2013-02-27 19:44:34 +09:00 • committed by Marcelo Tosatti
commit 7b6195a91d
7 changed files with 15 additions and 17 deletions

View file

@ -856,7 +856,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
slots = old_memslots;
}
r = kvm_arch_prepare_memory_region(kvm, &new, old, mem);
r = kvm_arch_prepare_memory_region(kvm, &new, mem, change);
if (r)
goto out_slots;