From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b82sr-0006SH-FC for qemu-devel@nongnu.org; Wed, 01 Jun 2016 05:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b82sl-0001VR-DT for qemu-devel@nongnu.org; Wed, 01 Jun 2016 05:56:16 -0400 References: <1464774685-7885-1-git-send-email-bharata@linux.vnet.ibm.com> <201606010952.u519n7R2025378@mx0a-001b2d01.pphosted.com> From: Paolo Bonzini Message-ID: <15984072-dfda-b4e8-f8b7-7b002c054fe5@redhat.com> Date: Wed, 1 Jun 2016 11:56:07 +0200 MIME-Version: 1.0 In-Reply-To: <201606010952.u519n7R2025378@mx0a-001b2d01.pphosted.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v0 1/2] kvm: API to obtain max supported mem slots List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, thuth@redhat.com, imammedo@redhat.com On 01/06/2016 11:51, Bharata B Rao wrote: > 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 > --- > include/sysemu/kvm.h | 1 + > kvm-all.c | 7 +++++++ > 2 files changed, 8 insertions(+) > > diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h > index 65569ed..ad6f837 100644 > --- a/include/sysemu/kvm.h > +++ b/include/sysemu/kvm.h > @@ -527,4 +527,5 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source); > * Returns: 0 on success, or a negative errno on failure. > */ > int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); > +int kvm_get_max_memslots(void); > #endif > diff --git a/kvm-all.c b/kvm-all.c > index d317dcb..fbd2d93 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; > Acked-by: Paolo Bonzini