qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 04/10] qom: add get_id
Date: Fri, 25 May 2012 21:39:34 +0400 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.00.1205252138340.2924@linmac> (raw)
In-Reply-To: <4FBFB446.7080105@suse.de>

On Fri, 25 May 2012, Andreas F?rber wrote:

> Am 23.05.2012 17:44, schrieb Paolo Bonzini:
> > Some classes may present objects differently in errors, for example if they
> > are not part of the composition tree or if they are not assigned an id by
> > the user.  Let them do this with a get_id method on Object, and use the
> > method consistently where a %(device) appears in the error.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> This patch looks new, so it's not covered by Anthony's carte blanche to
> take Paolo's patches into qom-next.
> 
> Generally I'm fine with it, some formal issues below.
> 
> > ---
> >  hw/qdev-properties.c  |    6 +++---
> >  hw/qdev.c             |   15 ++++++++++++++-
> >  include/qemu/object.h |   11 +++++++++++
> >  qom/object.c          |   26 +++++++++++++++++++++++++-
> >  4 files changed, 53 insertions(+), 5 deletions(-)
> 
> > diff --git a/hw/qdev.c b/hw/qdev.c
> > index e909f3b..5d6dc1f 100644
> > --- a/hw/qdev.c
> > +++ b/hw/qdev.c
> [...]
> > @@ -714,6 +714,13 @@ static void device_finalize(Object *obj)
> >      }
> >  }
> >  
> > +static const char *qdev_get_id(Object *obj)
> > +{
> > +    DeviceState *dev = DEVICE(obj);
> > +
> > +    return dev->id?:object_get_typename(obj);
> 
> Spaces around ?: please.

Even better is to not use gcc extensions like this one.

> 
> > +}
> > +
> >  static void device_class_base_init(ObjectClass *class, void *data)
> >  {
> >      DeviceClass *klass = DEVICE_CLASS(class);
> [...]
> > diff --git a/qom/object.c b/qom/object.c
> > index 68a4c57..b19ef94 100644
> > --- a/qom/object.c
> > +++ b/qom/object.c
> > @@ -334,6 +334,24 @@ static void object_property_del_child(Object *obj, Object *child, Error **errp)
> >      }
> >  }
> >  
> > +static const char *_object_get_id(Object *obj)
> 
> malc's alarm bells will be ringing: Use of an identifier starting with
> underscore.

Given that it's forbidden in this context - yeah.

[..snip..]

-- 
mailto:av1474@comtv.ru

  reply	other threads:[~2012-05-25 17:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 15:44 [Qemu-devel] [PATCH 00/10] push static properties to Object, add realized property Paolo Bonzini
2012-05-23 15:44 ` [Qemu-devel] [PATCH 01/10] qdev: remove PropertyInfo range checking Paolo Bonzini
2012-05-24 17:50   ` Andreas Färber
2012-05-23 15:44 ` [Qemu-devel] [PATCH 02/10] qdev: remove qdev_prop_exists Paolo Bonzini
2012-05-24 21:34   ` Andreas Färber
2012-05-25  7:20     ` Paolo Bonzini
2012-05-25 15:57   ` Andreas Färber
2012-05-23 15:44 ` [Qemu-devel] [PATCH 03/10] qom: push error reporting to object_property_find Paolo Bonzini
2012-05-25 16:05   ` Andreas Färber
2012-05-26  9:58     ` Paolo Bonzini
2012-05-26 22:04       ` Andreas Färber
2012-05-23 15:44 ` [Qemu-devel] [PATCH 04/10] qom: add get_id Paolo Bonzini
2012-05-25 16:33   ` Andreas Färber
2012-05-25 17:39     ` malc [this message]
2012-05-23 15:44 ` [Qemu-devel] [PATCH 05/10] qdev: push state up to Object Paolo Bonzini
2012-05-25 16:58   ` Andreas Färber
2012-05-23 15:44 ` [Qemu-devel] [PATCH 06/10] qdev: generalize properties to Objects Paolo Bonzini
2012-05-23 15:44 ` [Qemu-devel] [PATCH 07/10] qdev: move bulk of qdev-properties.c to qom/object.c Paolo Bonzini
2012-05-25 13:32   ` Andreas Färber
2012-05-25 13:36     ` Paolo Bonzini
2012-05-23 15:44 ` [Qemu-devel] [PATCH 08/10] qom: push static properties to Object Paolo Bonzini
2012-06-07 16:36   ` Andreas Färber
2012-05-23 15:44 ` [Qemu-devel] [PATCH 09/10] qom: add realized property Paolo Bonzini
2012-05-23 15:44 ` [Qemu-devel] [PATCH 10/10] qom: Add QERR_PROPERTY_SET_AFTER_REALIZE Paolo Bonzini

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=alpine.LNX.2.00.1205252138340.2924@linmac \
    --to=av1474@comtv.ru \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).