From 44f2e6c10eb2bf5dc3e36372ed574f71e80dba30 Mon Sep 17 00:00:00 2001 From: Bharata B Rao Date: Wed, 1 Jun 2016 15:21:24 +0530 Subject: 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 Acked-by: Paolo Bonzini Signed-off-by: David Gibson --- kvm-all.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kvm-all.c') 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; -- cgit v1.2.3