From: Thomas Huth <thuth@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
pkrempa@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
rjones@redhat.com, "Gerd Hoffmann" <kraxel@redhat.com>,
"Michael Roth" <mdroth@linux.vnet.ibm.com>,
qemu-block@nongnu.org, "Juan Quintela" <quintela@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
armbru@redhat.com, "Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"open list:S390 KVM CPUs" <qemu-s390x@nongnu.org>,
"open list:GLUSTER" <integration@gluster.org>,
stefanha@redhat.com, "Richard Henderson" <rth@twiddle.net>,
kwolf@redhat.com, vsementsov@virtuozzo.com,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Max Reitz" <mreitz@redhat.com>,
"open list:ARM TCG CPUs" <qemu-arm@nongnu.org>,
"open list:PowerPC TCG CPUs" <qemu-ppc@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible
Date: Tue, 27 Oct 2020 06:53:07 +0100 [thread overview]
Message-ID: <c7bb1341-bdbf-8ef5-4933-0e8580babdce@redhat.com> (raw)
In-Reply-To: <20201027050556.269064-12-eblake@redhat.com>
On 27/10/2020 06.05, Eric Blake wrote:
> Anywhere we create a list of just one item or by prepending items
> (typically because order doesn't matter), we can use the now-public
> macro. But places where we must keep the list in order by appending
> remain open-coded.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> docs/devel/writing-qmp-commands.txt | 13 +++------
> hw/net/rocker/rocker_fp.h | 2 +-
> block/gluster.c | 19 +++++--------
> chardev/char.c | 21 +++++++--------
> hw/core/machine.c | 6 +----
> hw/net/rocker/rocker.c | 8 +++---
> hw/net/rocker/rocker_fp.c | 14 +++++-----
> hw/net/virtio-net.c | 21 +++++----------
> migration/migration.c | 7 ++---
> migration/postcopy-ram.c | 7 ++---
> monitor/hmp-cmds.c | 11 ++++----
> qemu-img.c | 5 ++--
> qga/commands-posix.c | 13 +++------
> qga/commands-win32.c | 17 +++---------
> qga/commands.c | 6 +----
> qom/qom-qmp-cmds.c | 29 ++++++--------------
> target/arm/helper.c | 6 +----
> target/arm/monitor.c | 13 ++-------
> target/i386/cpu.c | 6 +----
> target/mips/helper.c | 6 +----
> target/s390x/cpu_models.c | 12 ++-------
> tests/test-clone-visitor.c | 7 ++---
> tests/test-qobject-output-visitor.c | 42 ++++++++++++++---------------
> tests/test-visitor-serialization.c | 5 +---
> trace/qmp.c | 22 +++++++--------
> ui/vnc.c | 21 +++++----------
> util/qemu-config.c | 14 +++-------
> target/ppc/translate_init.c.inc | 12 ++-------
> 28 files changed, 119 insertions(+), 246 deletions(-)
>
> diff --git a/docs/devel/writing-qmp-commands.txt b/docs/devel/writing-qmp-commands.txt
> index 46a6c48683f5..3e11eeaa1893 100644
> --- a/docs/devel/writing-qmp-commands.txt
> +++ b/docs/devel/writing-qmp-commands.txt
> @@ -531,15 +531,10 @@ TimerAlarmMethodList *qmp_query_alarm_methods(Error **errp)
> bool current = true;
>
> for (p = alarm_timers; p->name; p++) {
> - TimerAlarmMethodList *info = g_malloc0(sizeof(*info));
> - info->value = g_malloc0(sizeof(*info->value));
> - info->value->method_name = g_strdup(p->name);
> - info->value->current = current;
> -
> - current = false;
> -
> - info->next = method_list;
> - method_list = info;
> + TimerAlarmMethod *value = g_new0(TimerAlarmMethod, 1);
White space damage - please replace the TAB with spaces.
> + value->method_name = g_strdup(p->name);
> + value->current = current;
> + QAPI_LIST_ADD(method_list, value);
> }
Thomas
next prev parent reply other threads:[~2020-10-27 5:54 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 5:05 [PATCH v6 00/11] Exposing backing-chain allocation over NBD Eric Blake
2020-10-27 5:05 ` [PATCH v6 01/11] block: Simplify QAPI_LIST_ADD Eric Blake
2020-10-27 10:06 ` Vladimir Sementsov-Ogievskiy
2020-10-27 12:58 ` Markus Armbruster
2020-10-27 5:05 ` [PATCH v6 02/11] qapi: Make QAPI_LIST_ADD() public Eric Blake
2020-10-27 5:05 ` [PATCH v6 03/11] nbd: Utilize QAPI_CLONE for type conversion Eric Blake
2020-10-27 5:05 ` [PATCH v6 04/11] nbd: Update qapi to support exporting multiple bitmaps Eric Blake
2020-10-27 10:29 ` Vladimir Sementsov-Ogievskiy
2020-10-27 12:37 ` Peter Krempa
2020-10-27 5:05 ` [PATCH v6 05/11] nbd: Simplify qemu bitmap context name Eric Blake
2020-10-27 5:05 ` [PATCH v6 06/11] nbd: Refactor counting of metadata contexts Eric Blake
2020-10-27 10:33 ` Vladimir Sementsov-Ogievskiy
2020-10-27 5:05 ` [PATCH v6 07/11] nbd: Allow export of multiple bitmaps for one device Eric Blake
2020-10-27 5:05 ` [PATCH v6 08/11] block: Return depth level during bdrv_is_allocated_above Eric Blake
2020-10-27 12:05 ` Vladimir Sementsov-Ogievskiy
2020-10-27 5:05 ` [PATCH v6 09/11] nbd: Add new qemu:allocation-depth metadata context Eric Blake
2020-10-27 10:53 ` Vladimir Sementsov-Ogievskiy
2020-10-27 5:05 ` [PATCH v6 10/11] nbd: Add 'qemu-nbd -A' to expose allocation depth Eric Blake
2020-10-27 11:03 ` Vladimir Sementsov-Ogievskiy
2020-10-27 5:05 ` [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible Eric Blake
2020-10-27 5:53 ` Thomas Huth [this message]
2020-10-27 6:39 ` David Gibson
2020-10-27 10:09 ` Markus Armbruster
2020-10-27 12:28 ` Eric Blake
2020-10-27 15:36 ` Markus Armbruster
2020-10-27 18:44 ` Eric Blake
2020-10-27 11:26 ` Dr. David Alan Gilbert
2020-10-27 13:42 ` Vladimir Sementsov-Ogievskiy
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=c7bb1341-bdbf-8ef5-4933-0e8580babdce@redhat.com \
--to=thuth@redhat.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=integration@gluster.org \
--cc=jasowang@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jiri@resnulli.us \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pkrempa@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=quintela@redhat.com \
--cc=rjones@redhat.com \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.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).