qapi: Use QAPI_LIST_PREPEND() where possible
Anywhere we create a list of just one item or by prepending items (typically because order doesn't matter), we can use QAPI_LIST_PREPEND(). But places where we must keep the list in order by appending remain open-coded until later patches. Note that as a side effect, this also performs a cleanup of two minor issues in qga/commands-posix.c: the old code was performing new = g_malloc0(sizeof(*ret)); which 1) is confusing because you have to verify whether 'new' and 'ret' are variables with the same type, and 2) would conflict with C++ compilation (not an actual problem for this file, but makes copy-and-paste harder). Signed-off-by:Eric Blake <eblake@redhat.com> Message-Id: <20201113011340.463563-5-eblake@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Acked-by:
Stefan Hajnoczi <stefanha@redhat.com> [Straightforward conflicts due to commit a8aa94b5 "qga: update schema for guest-get-disks 'dependents' field" and commit a10b453a "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c" resolved. Commit message tweaked.] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
Showing
- block/gluster.c 2 additions, 2 deletionsblock/gluster.c
- block/qapi.c 2 additions, 5 deletionsblock/qapi.c
- chardev/char.c 8 additions, 12 deletionschardev/char.c
- docs/devel/writing-qmp-commands.txt 4 additions, 8 deletionsdocs/devel/writing-qmp-commands.txt
- hw/core/machine-qmp-cmds.c 1 addition, 5 deletionshw/core/machine-qmp-cmds.c
- hw/core/machine.c 2 additions, 9 deletionshw/core/machine.c
- hw/net/rocker/rocker_of_dpa.c 5 additions, 15 deletionshw/net/rocker/rocker_of_dpa.c
- hw/net/virtio-net.c 7 additions, 14 deletionshw/net/virtio-net.c
- migration/migration.c 2 additions, 5 deletionsmigration/migration.c
- migration/postcopy-ram.c 2 additions, 5 deletionsmigration/postcopy-ram.c
- monitor/hmp-cmds.c 7 additions, 6 deletionsmonitor/hmp-cmds.c
- monitor/misc.c 9 additions, 16 deletionsmonitor/misc.c
- monitor/qmp-cmds-control.c 5 additions, 5 deletionsmonitor/qmp-cmds-control.c
- qemu-img.c 2 additions, 3 deletionsqemu-img.c
- qga/commands-posix-ssh.c 1 addition, 6 deletionsqga/commands-posix-ssh.c
- qga/commands-posix.c 11 additions, 36 deletionsqga/commands-posix.c
- qga/commands-win32.c 8 additions, 24 deletionsqga/commands-win32.c
- qga/commands.c 1 addition, 5 deletionsqga/commands.c
- qom/qom-qmp-cmds.c 8 additions, 21 deletionsqom/qom-qmp-cmds.c
- target/arm/helper.c 1 addition, 5 deletionstarget/arm/helper.c
Loading
Please register or sign in to comment