qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 1/4] qom: make object_ref/unref use a void * instead of Object *.
Date: Fri, 24 Jul 2020 10:06:51 +0100	[thread overview]
Message-ID: <20200724090651.GA3146350@redhat.com> (raw)
In-Reply-To: <c8ac5a99-6a66-e0ad-6876-aa1064e07541@redhat.com>

On Thu, Jul 23, 2020 at 02:04:45PM -0500, Eric Blake wrote:
> On 7/23/20 1:14 PM, Daniel P. Berrangé wrote:
> > The object_ref/unref methods are intended for use with any subclass of
> > the base Object. Using "Object *" in the signature is not adding any
> > meaningful level of type safety, since callers simply use "OBJECT(ptr)"
> > and this expands to an unchecked cast "(Object *)".
> > 
> > By using "void *" we enable the object_unref() method to be used to
> > provide support for g_autoptr() with any subclass.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >   include/qom/object.h | 4 ++--
> >   qom/object.c         | 6 ++++--
> >   2 files changed, 6 insertions(+), 4 deletions(-)
> 
> Is it worth a followup patch (probably with Coccinelle) that changes:
> 
> object_ref(OBJECT(dev));
> 
> to the now-simpler
> 
> object_ref(dev);

Yes, its worth a cleanup.

> But I don't think it belongs in this patch, so
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

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:[~2020-07-24  9:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 18:14 [PATCH 0/4] qom: reduce boilerplate required for declaring and defining objects Daniel P. Berrangé
2020-07-23 18:14 ` [PATCH 1/4] qom: make object_ref/unref use a void * instead of Object * Daniel P. Berrangé
2020-07-23 19:04   ` Eric Blake
2020-07-24  9:06     ` Daniel P. Berrangé [this message]
2020-07-23 18:14 ` [PATCH 2/4] qom: provide convenient macros for declaring and defining types Daniel P. Berrangé
2020-07-23 19:23   ` Eric Blake
2020-07-24  9:11     ` Daniel P. Berrangé
2020-08-09  4:21   ` Eduardo Habkost
2020-08-11 18:22   ` Eduardo Habkost
2020-07-23 18:14 ` [PATCH 3/4] crypto: use QOM macros for declaration/definition of secret types Daniel P. Berrangé
2020-07-23 18:50   ` Eduardo Habkost
2020-07-24  9:12     ` Daniel P. Berrangé
2020-08-06 18:01       ` Eduardo Habkost
2020-08-07 11:11         ` Daniel P. Berrangé
2020-08-08  1:38           ` Eduardo Habkost
2020-07-23 19:25   ` Eric Blake
2020-07-23 18:14 ` [PATCH 4/4] crypto: use QOM macros for declaration/definition of TLS creds types Daniel P. Berrangé
2020-07-23 19:26   ` Eric Blake

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=20200724090651.GA3146350@redhat.com \
    --to=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).