aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-12-10 12:33:32 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2012-12-13 20:25:24 -0500
commit1e702d9af5d633cf0eca76f6340b3c50fbb5a4e5 (patch)
treed4ef29de97fc976ed7245c629b6f8a41fd660f86 /virt
parent6104f472a5ea287fbdcf4644e74867dfd905a018 (diff)
KVM: struct kvm_memory_slot.id -> short
We're currently offering a whopping 32 memory slots to user space, an int is a bit excessive for storing this. We would like to increase our memslots, but SHRT_MAX should be more than enough. 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')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 42c1eb73a0e3..bd31096e3698 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -474,6 +474,8 @@ static struct kvm *kvm_create_vm(unsigned long type)
474 INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list); 474 INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list);
475#endif 475#endif
476 476
477 BUILD_BUG_ON(KVM_MEM_SLOTS_NUM > SHRT_MAX);
478
477 r = -ENOMEM; 479 r = -ENOMEM;
478 kvm->memslots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL); 480 kvm->memslots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
479 if (!kvm->memslots) 481 if (!kvm->memslots)