summaryrefslogtreecommitdiffstats
path: root/kvm-all.c
diff options
context:
space:
mode:
authorBharata B Rao2016-06-01 11:51:24 +0200
committerDavid Gibson2016-06-07 02:17:45 +0200
commit44f2e6c10eb2bf5dc3e36372ed574f71e80dba30 (patch)
treefab3d49edebbe1a1571f84296750ab27e328ae29 /kvm-all.c
parenttarget-ppc/fpu_helper: Fix efscmp* instructions handling (diff)
downloadqemu-44f2e6c10eb2bf5dc3e36372ed574f71e80dba30.tar.gz
qemu-44f2e6c10eb2bf5dc3e36372ed574f71e80dba30.tar.xz
qemu-44f2e6c10eb2bf5dc3e36372ed574f71e80dba30.zip
kvm: API to obtain max supported mem slots
Introduce kvm_get_max_memslots() API that can be used to obtain the maximum number of memslots supported by KVM. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index d317dcb33e..fbd2d93188 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -126,6 +126,13 @@ static const KVMCapabilityInfo kvm_required_capabilites[] = {
KVM_CAP_LAST_INFO
};
+int kvm_get_max_memslots(void)
+{
+ KVMState *s = KVM_STATE(current_machine->accelerator);
+
+ return s->nr_slots;
+}
+
static KVMSlot *kvm_get_free_slot(KVMMemoryListener *kml)
{
KVMState *s = kvm_state;