[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v0 1/2] kvm: API to obtain max supported mem
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [RFC PATCH v0 1/2] kvm: API to obtain max supported mem slots |
Date: |
Thu, 2 Jun 2016 10:41:50 +1000 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Wed, Jun 01, 2016 at 11:56:07AM +0200, Paolo Bonzini wrote:
>
>
> 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 <address@hidden>
> > ---
> > 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 <address@hidden>
Thanks for the ack, I've merged this into my tree.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature