summaryrefslogtreecommitdiff
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorIzik Eidus <izike@qumranet.com>2007-10-24 23:52:57 +0200
committerAvi Kivity <avi@qumranet.com>2008-01-30 17:52:56 +0200
commit210c7c4d7f200f00ec34960a8c96bb990cbd266d (patch)
treefa6b1b15d4b3db3a55c42ec991ad413278a7654a /drivers/kvm/kvm_main.c
parent80b14b5b32cb0a98234283daf9b5a6643e1a1ef3 (diff)
downloadlwn-210c7c4d7f200f00ec34960a8c96bb990cbd266d.tar.gz
lwn-210c7c4d7f200f00ec34960a8c96bb990cbd266d.zip
KVM: Export memory slot allocation mechanism
Remove kvm memory slot allocation mechanism from the ioctl and put it to exported function. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index ab2c77c9ecef..5113cbf75674 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -643,10 +643,9 @@ EXPORT_SYMBOL_GPL(fx_init);
*
* Discontiguous memory is allowed, mostly for framebuffers.
*/
-static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
- struct
- kvm_userspace_memory_region *mem,
- int user_alloc)
+int kvm_set_memory_region(struct kvm *kvm,
+ struct kvm_userspace_memory_region *mem,
+ int user_alloc)
{
int r;
gfn_t base_gfn;
@@ -789,6 +788,16 @@ out_unlock:
kvm_free_physmem_slot(&new, &old);
out:
return r;
+
+}
+EXPORT_SYMBOL_GPL(kvm_set_memory_region);
+
+static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
+ struct
+ kvm_userspace_memory_region *mem,
+ int user_alloc)
+{
+ return kvm_set_memory_region(kvm, mem, user_alloc);
}
static int kvm_vm_ioctl_set_nr_mmu_pages(struct kvm *kvm,