aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2013-10-07 12:48:00 -0400
committerAlexander Graf <agraf@suse.de>2013-10-17 09:49:23 -0400
commit5587027ce9d59a57aecaa190be1c8e560aaff45d (patch)
tree866ecafdd194b2ce1669fa4ecfc47c4f24202fa0 /virt
parent2ba9f0d8875073a2ed802fca0c25c9bfc4338439 (diff)
kvm: Add struct kvm arg to memslot APIs
We will use that in the later patch to find the kvm ops handler Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 94c6e3f6f244..0932c3b64155 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -542,13 +542,13 @@ static void kvm_destroy_dirty_bitmap(struct kvm_memory_slot *memslot)
542/* 542/*
543 * Free any memory in @free but not in @dont. 543 * Free any memory in @free but not in @dont.
544 */ 544 */
545static void kvm_free_physmem_slot(struct kvm_memory_slot *free, 545static void kvm_free_physmem_slot(struct kvm *kvm, struct kvm_memory_slot *free,
546 struct kvm_memory_slot *dont) 546 struct kvm_memory_slot *dont)
547{ 547{
548 if (!dont || free->dirty_bitmap != dont->dirty_bitmap) 548 if (!dont || free->dirty_bitmap != dont->dirty_bitmap)
549 kvm_destroy_dirty_bitmap(free); 549 kvm_destroy_dirty_bitmap(free);
550 550
551 kvm_arch_free_memslot(free, dont); 551 kvm_arch_free_memslot(kvm, free, dont);
552 552
553 free->npages = 0; 553 free->npages = 0;
554} 554}
@@ -559,7 +559,7 @@ void kvm_free_physmem(struct kvm *kvm)
559 struct kvm_memory_slot *memslot; 559 struct kvm_memory_slot *memslot;
560 560
561 kvm_for_each_memslot(memslot, slots) 561 kvm_for_each_memslot(memslot, slots)
562 kvm_free_physmem_slot(memslot, NULL); 562 kvm_free_physmem_slot(kvm, memslot, NULL);
563 563
564 kfree(kvm->memslots); 564 kfree(kvm->memslots);
565} 565}
@@ -823,7 +823,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
823 if (change == KVM_MR_CREATE) { 823 if (change == KVM_MR_CREATE) {
824 new.userspace_addr = mem->userspace_addr; 824 new.userspace_addr = mem->userspace_addr;
825 825
826 if (kvm_arch_create_memslot(&new, npages)) 826 if (kvm_arch_create_memslot(kvm, &new, npages))
827 goto out_free; 827 goto out_free;
828 } 828 }
829 829
@@ -899,7 +899,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
899 899
900 kvm_arch_commit_memory_region(kvm, mem, &old, change); 900 kvm_arch_commit_memory_region(kvm, mem, &old, change);
901 901
902 kvm_free_physmem_slot(&old, &new); 902 kvm_free_physmem_slot(kvm, &old, &new);
903 kfree(old_memslots); 903 kfree(old_memslots);
904 904
905 return 0; 905 return 0;
@@ -907,7 +907,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
907out_slots: 907out_slots:
908 kfree(slots); 908 kfree(slots);
909out_free: 909out_free:
910 kvm_free_physmem_slot(&new, &old); 910 kvm_free_physmem_slot(kvm, &new, &old);
911out: 911out:
912 return r; 912 return r;
913} 913}