diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2011-11-24 04:39:18 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-12-27 04:17:37 -0500 |
commit | be6ba0f0962a39091c52eb9167ddea201fe80716 (patch) | |
tree | 52e46aad8cce4857def4dc03fc75955677027054 /arch/ia64 | |
parent | be593d6286075801bba6d60fa466a39c24cc7616 (diff) |
KVM: introduce kvm_for_each_memslot macro
Introduce kvm_for_each_memslot to walk all valid memslot
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 43f4c92816ef..42ad1f9c9f01 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1366,14 +1366,12 @@ static void kvm_release_vm_pages(struct kvm *kvm) | |||
1366 | { | 1366 | { |
1367 | struct kvm_memslots *slots; | 1367 | struct kvm_memslots *slots; |
1368 | struct kvm_memory_slot *memslot; | 1368 | struct kvm_memory_slot *memslot; |
1369 | int i, j; | 1369 | int j; |
1370 | unsigned long base_gfn; | 1370 | unsigned long base_gfn; |
1371 | 1371 | ||
1372 | slots = kvm_memslots(kvm); | 1372 | slots = kvm_memslots(kvm); |
1373 | for (i = 0; i < slots->nmemslots; i++) { | 1373 | kvm_for_each_memslot(memslot, slots) { |
1374 | memslot = &slots->memslots[i]; | ||
1375 | base_gfn = memslot->base_gfn; | 1374 | base_gfn = memslot->base_gfn; |
1376 | |||
1377 | for (j = 0; j < memslot->npages; j++) { | 1375 | for (j = 0; j < memslot->npages; j++) { |
1378 | if (memslot->rmap[j]) | 1376 | if (memslot->rmap[j]) |
1379 | put_page((struct page *)memslot->rmap[j]); | 1377 | put_page((struct page *)memslot->rmap[j]); |