qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH] qom: Rename object_new_with_props to object_new_child
Date: Fri, 17 Aug 2018 11:04:24 +0100	[thread overview]
Message-ID: <20180817100424.GA21930@redhat.com> (raw)
In-Reply-To: <20180817095944.GF11124@redhat.com>

On Fri, Aug 17, 2018 at 10:59:44AM +0100, Daniel P. Berrangé wrote:
> On Fri, Aug 17, 2018 at 11:58:07AM +0200, Thomas Huth wrote:
> > On 08/17/2018 11:48 AM, Daniel P. Berrangé wrote:
> > > On Fri, Aug 17, 2018 at 09:33:33AM +0200, Thomas Huth wrote:
> > >> While adding the object_initialize_child() function, Paolo suggested
> > >> to rename the similar object_new_with_props() function accordingly:
> > >>
> > >> http://marc.info/?i=e034610d-9a1d-a8a5-ee92-b2e3f0ba2891@redhat.com
> > >>
> > >> This way it is more obvious that this function creates a new object
> > >> as a child of another object.
> > > 
> > > I'd expect 'object_new_with_child' to be the same as 'object_new',
> > > but with only 'parent' & 'id' args added, which isn't the case here.
> > > 
> > > If we want the full & consistent design then we should have
> > > 
> > >   object_new(typename)
> > >   object_new_with_child(typename, parent, id)
> > >   object_new_props(typename, ...)
> > >   object_new_propv(typename, va_arg props)
> > >   object_new_with_child_props(typename, parent, id, ...)
> > >   object_new_with_child_propv(typename, parent, id, va_arg props)
> > 
> > "new_with_child" sounds wrong, too, since the parent is not created
> > here, but the child. Anyway, I guess the naming of these functions is
> > too much subject to bikeshedding, so never mind, let's keep it as it
> > currently is.
> 
> True, 'new_with_parent' is a better choice in retrospect :-)

Or indeed 'object_new_child' and 'object_new_child_prop{s,v}' approx as
you had suggested


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2018-08-17 10:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  7:33 [Qemu-devel] [RFC PATCH] qom: Rename object_new_with_props to object_new_child Thomas Huth
2018-08-17  9:48 ` Daniel P. Berrangé
2018-08-17  9:58   ` Thomas Huth
2018-08-17  9:59     ` Daniel P. Berrangé
2018-08-17 10:04       ` Daniel P. Berrangé [this message]
2018-08-17 10:52         ` 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=20180817100424.GA21930@redhat.com \
    --to=berrange@redhat.com \
    --cc=afaerber@suse.de \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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).