[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible
From: |
Thomas Huth |
Subject: |
Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible |
Date: |
Tue, 27 Oct 2020 06:53:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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
- [PATCH v6 07/11] nbd: Allow export of multiple bitmaps for one device, (continued)
- [PATCH v6 07/11] nbd: Allow export of multiple bitmaps for one device, Eric Blake, 2020/10/27
- [PATCH v6 03/11] nbd: Utilize QAPI_CLONE for type conversion, Eric Blake, 2020/10/27
- [PATCH v6 09/11] nbd: Add new qemu:allocation-depth metadata context, Eric Blake, 2020/10/27
- [PATCH v6 06/11] nbd: Refactor counting of metadata contexts, Eric Blake, 2020/10/27
- [PATCH v6 05/11] nbd: Simplify qemu bitmap context name, Eric Blake, 2020/10/27
- [PATCH v6 10/11] nbd: Add 'qemu-nbd -A' to expose allocation depth, Eric Blake, 2020/10/27
- [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible, Eric Blake, 2020/10/27
- Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible, Dr. David Alan Gilbert, 2020/10/27
- Re: [PATCH v6 11/11] qapi: Use QAPI_LIST_ADD() where possible, Vladimir Sementsov-Ogievskiy, 2020/10/27