[PATCH v2 0/7] Common macros for QAPI list growth

Eric Blake posted 7 patches 3 years, 4 months ago
Test checkpatch passed
Failed in applying to current master (apply log)
There is a newer version of this series
docs/devel/writing-qmp-commands.txt |  12 +--
hw/net/rocker/rocker_fp.h           |   2 +-
include/qapi/util.h                 |  13 +++
backends/hostmem.c                  |   8 +-
block/dirty-bitmap.c                |   6 +-
block/export/export.c               |   5 +-
block/gluster.c                     |  17 +--
block/qapi.c                        |  40 ++-----
block/qcow2-bitmap.c                |  11 +-
block/vmdk.c                        |   5 +-
blockdev.c                          |  11 +-
chardev/char.c                      |  20 ++--
crypto/block-luks.c                 |   9 +-
dump/dump.c                         |  22 ++--
hw/acpi/cpu.c                       |   6 +-
hw/acpi/memory_hotplug.c            |   7 +-
hw/core/machine-qmp-cmds.c          | 131 +++++++++--------------
hw/core/machine.c                   |  11 +-
hw/mem/memory-device.c              |  12 +--
hw/net/rocker/rocker.c              |   8 +-
hw/net/rocker/rocker_fp.c           |  17 +--
hw/net/rocker/rocker_of_dpa.c       |  20 +---
hw/net/virtio-net.c                 |  21 ++--
hw/pci/pci.c                        |  60 ++++-------
iothread.c                          |   8 +-
job-qmp.c                           |  11 +-
migration/migration.c               |  49 +++------
migration/postcopy-ram.c            |   7 +-
monitor/hmp-cmds.c                  |  44 ++++----
monitor/misc.c                      |  25 ++---
monitor/qmp-cmds-control.c          |  19 ++--
net/net.c                           |  15 +--
qemu-img.c                          |  11 +-
qga/commands-posix-ssh.c            |   7 +-
qga/commands-posix.c                | 160 +++++++++-------------------
qga/commands-win32.c                | 127 +++++++---------------
qga/commands.c                      |   6 +-
qom/qom-qmp-cmds.c                  |  29 ++---
scsi/pr-manager.c                   |   8 +-
softmmu/tpm.c                       |  38 ++-----
target/arm/helper.c                 |   6 +-
target/arm/monitor.c                |  13 +--
target/i386/cpu.c                   |  25 ++---
target/mips/helper.c                |   6 +-
target/s390x/cpu_models.c           |  12 +--
tests/test-clone-visitor.c          |   7 +-
tests/test-qobject-output-visitor.c | 102 ++++++------------
tests/test-string-output-visitor.c  |   4 +-
tests/test-visitor-serialization.c  | 113 +++-----------------
trace/qmp.c                         |  22 ++--
ui/input.c                          |  16 ++-
ui/spice-core.c                     |  27 ++---
ui/vnc.c                            |  21 ++--
util/qemu-config.c                  |  14 +--
target/ppc/translate_init.c.inc     |  12 +--
55 files changed, 431 insertions(+), 1007 deletions(-)
[PATCH v2 0/7] Common macros for QAPI list growth
Posted by Eric Blake 3 years, 4 months ago
v1, as such, was here:
https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg08003.html
(v6 11/11 qapi: Use QAPI_LIST_ADD() where possible)

since then, I've rebased that patch (upstream went with PREPEND
instead of ADD), split things out for easier review, added
QAPI_LIST_APPEND, caught a lot more places that can use PREPEND, and
even fixed a years-old memory leak that might be worth having in 5.2.
But patches 2-7 are 6.0 material.

Eric Blake (7):
  net: Fix memory leak on error
  rocker: Revamp fp_port_get_info
  migration: Refactor migrate_cap_add
  qapi: Use QAPI_LIST_PREPEND() where possible
  qapi: Introduce QAPI_LIST_APPEND
  qapi: Use QAPI_LIST_APPEND in trivial cases
  qapi: More complex uses of QAPI_LIST_APPEND

 docs/devel/writing-qmp-commands.txt |  12 +--
 hw/net/rocker/rocker_fp.h           |   2 +-
 include/qapi/util.h                 |  13 +++
 backends/hostmem.c                  |   8 +-
 block/dirty-bitmap.c                |   6 +-
 block/export/export.c               |   5 +-
 block/gluster.c                     |  17 +--
 block/qapi.c                        |  40 ++-----
 block/qcow2-bitmap.c                |  11 +-
 block/vmdk.c                        |   5 +-
 blockdev.c                          |  11 +-
 chardev/char.c                      |  20 ++--
 crypto/block-luks.c                 |   9 +-
 dump/dump.c                         |  22 ++--
 hw/acpi/cpu.c                       |   6 +-
 hw/acpi/memory_hotplug.c            |   7 +-
 hw/core/machine-qmp-cmds.c          | 131 +++++++++--------------
 hw/core/machine.c                   |  11 +-
 hw/mem/memory-device.c              |  12 +--
 hw/net/rocker/rocker.c              |   8 +-
 hw/net/rocker/rocker_fp.c           |  17 +--
 hw/net/rocker/rocker_of_dpa.c       |  20 +---
 hw/net/virtio-net.c                 |  21 ++--
 hw/pci/pci.c                        |  60 ++++-------
 iothread.c                          |   8 +-
 job-qmp.c                           |  11 +-
 migration/migration.c               |  49 +++------
 migration/postcopy-ram.c            |   7 +-
 monitor/hmp-cmds.c                  |  44 ++++----
 monitor/misc.c                      |  25 ++---
 monitor/qmp-cmds-control.c          |  19 ++--
 net/net.c                           |  15 +--
 qemu-img.c                          |  11 +-
 qga/commands-posix-ssh.c            |   7 +-
 qga/commands-posix.c                | 160 +++++++++-------------------
 qga/commands-win32.c                | 127 +++++++---------------
 qga/commands.c                      |   6 +-
 qom/qom-qmp-cmds.c                  |  29 ++---
 scsi/pr-manager.c                   |   8 +-
 softmmu/tpm.c                       |  38 ++-----
 target/arm/helper.c                 |   6 +-
 target/arm/monitor.c                |  13 +--
 target/i386/cpu.c                   |  25 ++---
 target/mips/helper.c                |   6 +-
 target/s390x/cpu_models.c           |  12 +--
 tests/test-clone-visitor.c          |   7 +-
 tests/test-qobject-output-visitor.c | 102 ++++++------------
 tests/test-string-output-visitor.c  |   4 +-
 tests/test-visitor-serialization.c  | 113 +++-----------------
 trace/qmp.c                         |  22 ++--
 ui/input.c                          |  16 ++-
 ui/spice-core.c                     |  27 ++---
 ui/vnc.c                            |  21 ++--
 util/qemu-config.c                  |  14 +--
 target/ppc/translate_init.c.inc     |  12 +--
 55 files changed, 431 insertions(+), 1007 deletions(-)

-- 
2.28.0


Re: [PATCH v2 0/7] Common macros for QAPI list growth
Posted by Markus Armbruster 3 years, 4 months ago
Eric Blake <eblake@redhat.com> writes:

> v1, as such, was here:
> https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg08003.html
> (v6 11/11 qapi: Use QAPI_LIST_ADD() where possible)
>
> since then, I've rebased that patch (upstream went with PREPEND
> instead of ADD), split things out for easier review, added
> QAPI_LIST_APPEND, caught a lot more places that can use PREPEND, and
> even fixed a years-old memory leak that might be worth having in 5.2.
> But patches 2-7 are 6.0 material.
[...]
>  55 files changed, 431 insertions(+), 1007 deletions(-)

Lovely.  These two macros are obviously overdue.

Series needs a rebase.


Re: [PATCH v2 0/7] Common macros for QAPI list growth
Posted by Markus Armbruster 3 years, 3 months ago
Markus Armbruster <armbru@redhat.com> writes:

> Eric Blake <eblake@redhat.com> writes:
>
>> v1, as such, was here:
>> https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg08003.html
>> (v6 11/11 qapi: Use QAPI_LIST_ADD() where possible)
>>
>> since then, I've rebased that patch (upstream went with PREPEND
>> instead of ADD), split things out for easier review, added
>> QAPI_LIST_APPEND, caught a lot more places that can use PREPEND, and
>> even fixed a years-old memory leak that might be worth having in 5.2.
>> But patches 2-7 are 6.0 material.
> [...]
>>  55 files changed, 431 insertions(+), 1007 deletions(-)
>
> Lovely.  These two macros are obviously overdue.

I'm queuing PATCH 2-4.  We concluced PATCH 1 isn't necessary.  PATCH 7
needs work, and I gather you'd like to improve PATCH 5 (parenthesis in
macro expansion) and 6 (use the opportunity to improve variable naming).

> Series needs a rebase.

The conflicts are due to

    a8aa94b5f8 qga: update schema for guest-get-disks 'dependents' field
    a10b453a52 target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c

and easy enough to resolve for me.

Thanks!