diff options
author | Izik Eidus <izike@qumranet.com> | 2007-10-24 17:52:57 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:56 -0500 |
commit | 210c7c4d7f200f00ec34960a8c96bb990cbd266d (patch) | |
tree | fa6b1b15d4b3db3a55c42ec991ad413278a7654a /drivers | |
parent | 80b14b5b32cb0a98234283daf9b5a6643e1a1ef3 (diff) |
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')
-rw-r--r-- | drivers/kvm/kvm.h | 3 | ||||
-rw-r--r-- | drivers/kvm/kvm_main.c | 17 |
2 files changed, 16 insertions, 4 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 12de42c789a..f3dda088e34 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -513,6 +513,9 @@ struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); | |||
513 | extern struct page *bad_page; | 513 | extern struct page *bad_page; |
514 | 514 | ||
515 | int is_error_page(struct page *page); | 515 | int is_error_page(struct page *page); |
516 | int kvm_set_memory_region(struct kvm *kvm, | ||
517 | struct kvm_userspace_memory_region *mem, | ||
518 | int user_alloc); | ||
516 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 519 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
517 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 520 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
518 | void kvm_release_page(struct page *page); | 521 | void kvm_release_page(struct page *page); |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index ab2c77c9ece..5113cbf7567 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -643,10 +643,9 @@ EXPORT_SYMBOL_GPL(fx_init); | |||
643 | * | 643 | * |
644 | * Discontiguous memory is allowed, mostly for framebuffers. | 644 | * Discontiguous memory is allowed, mostly for framebuffers. |
645 | */ | 645 | */ |
646 | static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | 646 | int kvm_set_memory_region(struct kvm *kvm, |
647 | struct | 647 | struct kvm_userspace_memory_region *mem, |
648 | kvm_userspace_memory_region *mem, | 648 | int user_alloc) |
649 | int user_alloc) | ||
650 | { | 649 | { |
651 | int r; | 650 | int r; |
652 | gfn_t base_gfn; | 651 | gfn_t base_gfn; |
@@ -789,6 +788,16 @@ out_unlock: | |||
789 | kvm_free_physmem_slot(&new, &old); | 788 | kvm_free_physmem_slot(&new, &old); |
790 | out: | 789 | out: |
791 | return r; | 790 | return r; |
791 | |||
792 | } | ||
793 | EXPORT_SYMBOL_GPL(kvm_set_memory_region); | ||
794 | |||
795 | static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, | ||
796 | struct | ||
797 | kvm_userspace_memory_region *mem, | ||
798 | int user_alloc) | ||
799 | { | ||
800 | return kvm_set_memory_region(kvm, mem, user_alloc); | ||
792 | } | 801 | } |
793 | 802 | ||
794 | static int kvm_vm_ioctl_set_nr_mmu_pages(struct kvm *kvm, | 803 | static int kvm_vm_ioctl_set_nr_mmu_pages(struct kvm *kvm, |