KVM: PPC: Implement extension to report number of memslots
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Fri, 16 Oct 2015 04:57:53 +0000 (10:27 +0530)
committerPaul Mackerras <paulus@samba.org>
Wed, 21 Oct 2015 05:31:46 +0000 (16:31 +1100)
QEMU assumes 32 memslots if this extension is not implemented. Although,
current value of KVM_USER_MEM_SLOTS is 32, once KVM_USER_MEM_SLOTS
changes QEMU would take a wrong value.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kvm/powerpc.c

index 2e51289610e432b420310971afbe374f0e0938cf..6fd2405c7f4aa2e5bdc5ae417a409b33b6c5f7bd 100644 (file)
@@ -559,6 +559,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
                else
                        r = num_online_cpus();
                break;
+       case KVM_CAP_NR_MEMSLOTS:
+               r = KVM_USER_MEM_SLOTS;
+               break;
        case KVM_CAP_MAX_VCPUS:
                r = KVM_MAX_VCPUS;
                break;