From: David Gibson <david@gibson.dropbear.id.au>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Bharata B Rao <bharata@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org, thuth@redhat.com,
aik@ozlabs.ru, agraf@suse.de, pbonzini@redhat.com,
ehabkost@redhat.com, pkrempa@redhat.com,
mdroth@linux.vnet.ibm.com, eblake@redhat.com,
mjrosato@linux.vnet.ibm.com, borntraeger@de.ibm.com
Subject: Re: [Qemu-devel] [PATCH v4 1/9] qom: API to get instance_size of a type
Date: Wed, 15 Jun 2016 15:48:23 +1000 [thread overview]
Message-ID: <20160615054823.GE21472@voom.fritz.box> (raw)
In-Reply-To: <20160610093824.69b444c2@nial.brq.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2357 bytes --]
On Fri, Jun 10, 2016 at 09:38:24AM +0200, Igor Mammedov wrote:
> On Fri, 10 Jun 2016 14:04:41 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> > On Fri, Jun 10, 2016 at 06:29:00AM +0530, Bharata B Rao wrote:
> > > Add an API object_type_get_size(const char *typename) that returns the
> > > instance_size of the give typename.
> I'd rename it to
> object_type_get_instance_size()
> so it'd apparent what size is returned from name.
I'll make that change in my tree.
>
> > >
> > > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> >
> > Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> >
> > This looks sensible to me, it would be nice to have an ack or two from
> > the qemu community at large.
> >
> > > ---
> > > include/qom/object.h | 8 +++++++-
> > > qom/object.c | 8 ++++++++
> > > 2 files changed, 15 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/include/qom/object.h b/include/qom/object.h
> > > index 21bb5ff..460ddfc 100644
> > > --- a/include/qom/object.h
> > > +++ b/include/qom/object.h
> > > @@ -1608,5 +1608,11 @@ int object_child_foreach_recursive(Object *obj,
> > > */
> > > Object *container_get(Object *root, const char *path);
> > >
> > > -
> > > +/**
> > > + * object_type_get_size:
> > > + * @typename: Name of the Type whose instance_size is required
> > > + *
> > > + * Returns the instance_size of the given @typename.
> > > + */
> > > +size_t object_type_get_size(const char *typename);
> > > #endif
> > > diff --git a/qom/object.c b/qom/object.c
> > > index 3bc8a00..0e75877 100644
> > > --- a/qom/object.c
> > > +++ b/qom/object.c
> > > @@ -202,6 +202,14 @@ static size_t type_object_get_size(TypeImpl *ti)
> > > return 0;
> > > }
> > >
> > > +size_t object_type_get_size(const char *typename)
> > > +{
> > > + TypeImpl *type = type_get_by_name(typename);
> > > +
> > > + g_assert(type != NULL);
> > > + return type_object_get_size(type);
> > > +}
> > > +
> > > static bool type_is_ancestor(TypeImpl *type, TypeImpl *target_type)
> > > {
> > > assert(target_type);
> >
>
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-06-15 5:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 0:58 [Qemu-devel] [PATCH v4 0/9] Core based CPU hotplug for PowerPC sPAPR Bharata B Rao
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 1/9] qom: API to get instance_size of a type Bharata B Rao
2016-06-10 4:04 ` David Gibson
2016-06-10 7:38 ` Igor Mammedov
2016-06-15 5:48 ` David Gibson [this message]
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 2/9] spapr: Abstract CPU core device and type specific core devices Bharata B Rao
2016-06-10 4:24 ` David Gibson
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 3/9] spapr: Move spapr_cpu_init() to spapr_cpu_core.c Bharata B Rao
2016-06-10 4:27 ` David Gibson
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 4/9] spapr: convert boot CPUs into CPU core devices Bharata B Rao
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 5/9] spapr: CPU hotplug support Bharata B Rao
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 6/9] spapr: CPU hot unplug support Bharata B Rao
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 7/9] QMP: Add query-hotpluggable-cpus Bharata B Rao
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 8/9] hmp: Add 'info hotpluggable-cpus' HMP command Bharata B Rao
2016-06-10 8:34 ` David Gibson
2016-06-10 0:59 ` [Qemu-devel] [PATCH v4 9/9] spapr: implement query-hotpluggable-cpus callback Bharata B Rao
2016-06-10 5:14 ` [Qemu-devel] [PATCH v4 0/9] Core based CPU hotplug for PowerPC sPAPR David Gibson
2016-06-15 6:04 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2016-06-16 3:49 ` Bharata B Rao
2016-06-16 6:41 ` David Gibson
2016-06-16 11:49 ` Thomas Huth
2016-06-16 16:57 ` Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160615054823.GE21472@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=bharata@linux.vnet.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mjrosato@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).