aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-12-10 12:33:09 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2012-12-13 20:21:57 -0500
commitbbacc0c111c3c5d1f3192b8cc1642b9c3954f80d (patch)
tree2ccef1b8a73400c56a1ef2a3967d09606b8ab50a /virt/kvm/kvm_main.c
parentb7f69c555ca430129b6cde81e9f0927531420c5c (diff)
KVM: Rename KVM_MEMORY_SLOTS -> KVM_USER_MEM_SLOTS
It's easy to confuse KVM_MEMORY_SLOTS and KVM_MEM_SLOTS_NUM. One is the user accessible slots and the other is user + private. Make this more obvious. Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4c8c0657e370..5f0638cb6968 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -771,7 +771,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
771 /* Check for overlaps */ 771 /* Check for overlaps */
772 r = -EEXIST; 772 r = -EEXIST;
773 kvm_for_each_memslot(slot, kvm->memslots) { 773 kvm_for_each_memslot(slot, kvm->memslots) {
774 if (slot->id >= KVM_MEMORY_SLOTS || slot == memslot) 774 if (slot->id >= KVM_USER_MEM_SLOTS || slot == memslot)
775 continue; 775 continue;
776 if (!((base_gfn + npages <= slot->base_gfn) || 776 if (!((base_gfn + npages <= slot->base_gfn) ||
777 (base_gfn >= slot->base_gfn + slot->npages))) 777 (base_gfn >= slot->base_gfn + slot->npages)))
@@ -905,7 +905,7 @@ int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
905 kvm_userspace_memory_region *mem, 905 kvm_userspace_memory_region *mem,
906 int user_alloc) 906 int user_alloc)
907{ 907{
908 if (mem->slot >= KVM_MEMORY_SLOTS) 908 if (mem->slot >= KVM_USER_MEM_SLOTS)
909 return -EINVAL; 909 return -EINVAL;
910 return kvm_set_memory_region(kvm, mem, user_alloc); 910 return kvm_set_memory_region(kvm, mem, user_alloc);
911} 911}
@@ -919,7 +919,7 @@ int kvm_get_dirty_log(struct kvm *kvm,
919 unsigned long any = 0; 919 unsigned long any = 0;
920 920
921 r = -EINVAL; 921 r = -EINVAL;
922 if (log->slot >= KVM_MEMORY_SLOTS) 922 if (log->slot >= KVM_USER_MEM_SLOTS)
923 goto out; 923 goto out;
924 924
925 memslot = id_to_memslot(kvm->memslots, log->slot); 925 memslot = id_to_memslot(kvm->memslots, log->slot);
@@ -965,7 +965,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn)
965{ 965{
966 struct kvm_memory_slot *memslot = gfn_to_memslot(kvm, gfn); 966 struct kvm_memory_slot *memslot = gfn_to_memslot(kvm, gfn);
967 967
968 if (!memslot || memslot->id >= KVM_MEMORY_SLOTS || 968 if (!memslot || memslot->id >= KVM_USER_MEM_SLOTS ||
969 memslot->flags & KVM_MEMSLOT_INVALID) 969 memslot->flags & KVM_MEMSLOT_INVALID)
970 return 0; 970 return 0;
971 971