From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: berrange@redhat.com, armbru@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/3] qobject: replace qobject_incref/QINCREF qobject_decref/QDECREF
Date: Wed, 21 Mar 2018 09:28:33 -0500 [thread overview]
Message-ID: <5321b7df-215e-e56d-ae6d-2ada8706cdcc@redhat.com> (raw)
In-Reply-To: <20180321134005.8822-4-marcandre.lureau@redhat.com>
On 03/21/2018 08:40 AM, Marc-André Lureau wrote:
> Now that we can safely call QOBJECT() on QObject * and children types,
> we can have a single macro to ref/unref the object.
>
> Change the incref/decref prefix name for the more common ref/unref.
I know you did this by sed (for the most part); but it would be worth
including the command line you used in the commit message to make it
easier to reproduce the same mechanical portion of the patch when rebasing.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> +++ b/include/qapi/qmp/qobject.h
> @@ -74,13 +74,16 @@ qobject_unknown_type(const void *unused)
> (const QObject *, x), \
> qobject_unknown_type(x))
>
> -/* High-level interface for qobject_incref() */
> -#define QINCREF(obj) \
> - qobject_incref(QOBJECT(obj))
> +/**
> + * qobject_ref(): Increment QObject's reference count
> + */
> +#define qobject_ref(x) qobject_ref_impl(QOBJECT(x))
The meat of the patch; looks fine to me.
> +++ b/scripts/coccinelle/qobject.cocci
> @@ -3,11 +3,11 @@
> expression Obj, Key, E;
> @@
> (
> -- qobject_incref(QOBJECT(E));
> -+ QINCREF(E);
> +- qobject_ref(QOBJECT(E));
> ++ qobject_ref(E);
> |
> -- qobject_decref(QOBJECT(E));
> -+ QDECREF(E);
> +- qobject_unref(QOBJECT(E));
> ++ qobject_unref(E);
I wonder if these branches should just be removed; they made sense when
we had two spellings, but after your mass conversion, the .cocci script
is unlikely to ever find regressions on this front.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-03-21 14:28 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 13:40 [Qemu-devel] [PATCH 0/3] RFC: simplify qobject refcount Marc-André Lureau
2018-03-21 13:40 ` [Qemu-devel] [PATCH 1/3] compiler: extend QEMU_GENERIC to handle more arguments Marc-André Lureau
2018-03-21 13:40 ` [Qemu-devel] [PATCH 2/3] qobject: assume base of a qobject is at offset 0 Marc-André Lureau
2018-03-21 14:01 ` Paolo Bonzini
2018-03-21 14:08 ` Marc-André Lureau
2018-03-21 14:19 ` Eric Blake
2018-03-21 14:21 ` Marc-André Lureau
2018-03-21 14:49 ` Paolo Bonzini
2018-03-21 15:29 ` Eric Blake
2018-03-21 15:34 ` Paolo Bonzini
2018-03-21 15:55 ` Marc-André Lureau
2018-03-21 16:00 ` Paolo Bonzini
2018-03-21 16:11 ` Marc-André Lureau
2018-03-21 16:23 ` Paolo Bonzini
2018-03-21 16:59 ` Marc-André Lureau
2018-03-21 17:08 ` Eric Blake
2018-03-21 17:23 ` Marc-André Lureau
2018-03-21 17:38 ` Eric Blake
2018-03-21 17:43 ` Paolo Bonzini
2018-03-21 14:01 ` Eric Blake
2018-03-21 14:02 ` Paolo Bonzini
2018-03-21 13:40 ` [Qemu-devel] [PATCH 3/3] qobject: replace qobject_incref/QINCREF qobject_decref/QDECREF Marc-André Lureau
2018-03-21 14:28 ` Eric Blake [this message]
2018-03-21 14:51 ` Marc-André Lureau
2018-03-21 15:36 ` Eric Blake
2018-03-21 14:09 ` [Qemu-devel] [PATCH 0/3] RFC: simplify qobject refcount Eric Blake
2018-03-21 14:19 ` Marc-André Lureau
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=5321b7df-215e-e56d-ae6d-2ada8706cdcc@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@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).