diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2011-03-09 02:41:59 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:56:53 -0400 |
commit | 0ee8dcb87e403397e575674d0e79272b06dea12e (patch) | |
tree | 64fe3a441b259105ae4f38cbf4e7e3c9e204b9bd /virt | |
parent | 9f381a61f58bb6487c93ce2233bb9992f8ea9211 (diff) |
KVM: cleanup memslot_id function
We can get memslot id from memslot->id directly
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 6330653480e4..58146457bf97 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -996,23 +996,6 @@ out: | |||
996 | return size; | 996 | return size; |
997 | } | 997 | } |
998 | 998 | ||
999 | int memslot_id(struct kvm *kvm, gfn_t gfn) | ||
1000 | { | ||
1001 | int i; | ||
1002 | struct kvm_memslots *slots = kvm_memslots(kvm); | ||
1003 | struct kvm_memory_slot *memslot = NULL; | ||
1004 | |||
1005 | for (i = 0; i < slots->nmemslots; ++i) { | ||
1006 | memslot = &slots->memslots[i]; | ||
1007 | |||
1008 | if (gfn >= memslot->base_gfn | ||
1009 | && gfn < memslot->base_gfn + memslot->npages) | ||
1010 | break; | ||
1011 | } | ||
1012 | |||
1013 | return memslot - slots->memslots; | ||
1014 | } | ||
1015 | |||
1016 | static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn, | 999 | static unsigned long gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn, |
1017 | gfn_t *nr_pages) | 1000 | gfn_t *nr_pages) |
1018 | { | 1001 | { |