]> git.proxmox.com Git - mirror_qemu.git/commit - kvm-all.c
kvm: Query KVM for available memory slots
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 22 Nov 2013 19:12:44 +0000 (12:12 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Nov 2013 10:28:34 +0000 (11:28 +0100)
commitfb541ca59c8b55911821c9f794c3dbe5de9ba9d8
tree7b34bd0dc927322483b8098fcf483a4420b0fa4c
parent607bb022f2a44797cbf40e85e84da4134e2f0e01
kvm: Query KVM for available memory slots

KVM reports the number of available memory slots (KVM_CAP_NR_MEMSLOTS)
using the extension interface.  Both x86 and s390 implement this, ARM
and powerpc do not yet enable it.  Convert the static slots array to
be dynamically allocated, supporting more slots when available.
Default to 32 when KVM_CAP_NR_MEMSLOTS is not implemented.  The
motivation for this change is to support more assigned devices, where
memory mapped PCI MMIO BARs typically take one slot each.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
kvm-all.c