qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] a680ea: docs/devel/qapi-code-gen: Update exam


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] a680ea: docs/devel/qapi-code-gen: Update example to match ...
Date: Thu, 15 Dec 2022 02:13:30 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: a680ea072fd96ed28ccc479f018abb4bae649104
      
https://github.com/qemu/qemu/commit/a680ea072fd96ed28ccc479f018abb4bae649104
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M docs/devel/qapi-code-gen.rst

  Log Message:
  -----------
  docs/devel/qapi-code-gen: Update example to match current code

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-2-armbru@redhat.com>


  Commit: 7df184613c911c93490ee36eb73f97159ebe728a
      
https://github.com/qemu/qemu/commit/7df184613c911c93490ee36eb73f97159ebe728a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M docs/devel/qapi-code-gen.rst
    M scripts/qapi/commands.py
    M scripts/qapi/events.py

  Log Message:
  -----------
  qapi: Tidy up whitespace in generated code

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-3-armbru@redhat.com>


  Commit: 94f9bd33eece74810aee86de866b3cc86c3b0aec
      
https://github.com/qemu/qemu/commit/94f9bd33eece74810aee86de866b3cc86c3b0aec
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M docs/devel/qapi-code-gen.rst

  Log Message:
  -----------
  docs/devel/qapi-code-gen: Extend example for next commit's change

The next commit will change the code generated for some optional
members.  The example schema contains an optional member affected by
the change.  Add one that is not affected.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-4-armbru@redhat.com>


  Commit: 44ea9d9be33c8a4cf89132e0dc2b3029733bcaf4
      
https://github.com/qemu/qemu/commit/44ea9d9be33c8a4cf89132e0dc2b3029733bcaf4
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M docs/devel/qapi-code-gen.rst
    M docs/devel/writing-monitor-commands.rst
    M scripts/qapi/commands.py
    M scripts/qapi/events.py
    M scripts/qapi/gen.py
    M scripts/qapi/schema.py
    M scripts/qapi/types.py
    M scripts/qapi/visit.py

  Log Message:
  -----------
  qapi: Start to elide redundant has_FOO in generated C

In QAPI, absent optional members are distinct from any present value.
We thus represent an optional schema member FOO as two C members: a
FOO with the member's type, and a bool has_FOO.  Likewise for function
arguments.

However, has_FOO is actually redundant for a pointer-valued FOO, which
can be null only when has_FOO is false, i.e. has_FOO == !!FOO.  Except
for arrays, where we a null FOO can also be a present empty array.

The redundant has_FOO are a nuisance to work with.  Improve the
generator to elide them.  Uses of has_FOO need to be replaced as
follows.

Tests of has_FOO become the equivalent comparison of FOO with null.
For brevity, this is commonly done by implicit conversion to bool.

Assignments to has_FOO get dropped.

Likewise for arguments to has_FOO parameters.

Beware: code may violate the invariant has_FOO == !!FOO before the
transformation, and get away with it.  The above transformation can
then break things.  Two cases:

* Absent: if code ignores FOO entirely when !has_FOO (except for
  freeing it if necessary), even non-null / uninitialized FOO works.
  Such code is known to exist.

* Present: if code ignores FOO entirely when has_FOO, even null FOO
  works.  Such code should not exist.

In both cases, replacing tests of has_FOO by FOO reverts their sense.
We have to fix the value of FOO then.

To facilitate review of the necessary updates to handwritten code, add
means to opt out of this change, and opt out for all QAPI schema
modules where the change requires updates to handwritten code.  The
next few commits will remove these opt-outs in reviewable chunks, then
drop the means to opt out.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-5-armbru@redhat.com>


  Commit: 4b2fc7dbc4203c52b7726249328fcde49626f565
      
https://github.com/qemu/qemu/commit/4b2fc7dbc4203c52b7726249328fcde49626f565
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M scripts/qapi/schema.py
    M tests/qtest/qmp-cmd-test.c
    M tests/unit/test-qmp-cmds.c
    M tests/unit/test-qmp-event.c
    M tests/unit/test-qobject-input-visitor.c
    M tests/unit/test-qobject-output-visitor.c
    M tests/unit/test-visitor-serialization.c

  Log Message:
  -----------
  qapi tests: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for
tests/qapi-schema/qapi-schema-test.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-6-armbru@redhat.com>


  Commit: b94ba62fd470715f6290b74c7a878fe2d640e9af
      
https://github.com/qemu/qemu/commit/b94ba62fd470715f6290b74c7a878fe2d640e9af
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M hw/acpi/core.c
    M hw/acpi/cpu.c
    M hw/acpi/memory_hotplug.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi acpi: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/acpi.py.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-7-armbru@redhat.com>


  Commit: ceb19c8f684c7541ee878255ed686d92cfb90175
      
https://github.com/qemu/qemu/commit/ceb19c8f684c7541ee878255ed686d92cfb90175
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M audio/alsaaudio.c
    M audio/audio.c
    M audio/audio_legacy.c
    M audio/ossaudio.c
    M audio/paaudio.c
    M audio/sndioaudio.c
    M audio/wavaudio.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi audio: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/audio.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Additionally, helper get_str() loses its @has_dst parameter.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-8-armbru@redhat.com>


  Commit: 04658a5b90f48b269722631b4e51b21935a6be8d
      
https://github.com/qemu/qemu/commit/04658a5b90f48b269722631b4e51b21935a6be8d
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M blockdev.c

  Log Message:
  -----------
  blockdev: Clean up abuse of DriveBackup member format

drive-backup argument @format defaults to the format of the source
unless @mode is "existing".

drive_backup_prepare() implements this by copying the source's
@format_name to DriveBackup member @format.  It leaves @has_format
false, violating the "has_format == !!format" invariant.  Unclean.
Falls apart when we elide @has_format (commit after next): then QAPI
passes @format, which is a string constant, to g_free().  iotest 056
duly explodes.

Clean it up.  Since the value stored in member @format is not actually
used outside this function, use a local variable instead of modifying
the QAPI object.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Message-Id: <20221104160712.3005652-9-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>


  Commit: 8461b4d60153ba923c47b6e2f9e270c0e8d6d49c
      
https://github.com/qemu/qemu/commit/8461b4d60153ba923c47b6e2f9e270c0e8d6d49c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-13 (Tue, 13 Dec 2022)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Clean up abuse of BlockExportOptionsNbd member @arg

block-export-add argument @name defaults to the value of argument
@node-name.

nbd_export_create() implements this by copying @node_name to @name.
It leaves @has_node_name false, violating the "has_node_name ==
!!node_name" invariant.  Unclean.  Falls apart when we elide
@has_node_name (next commit): then QAPI frees the same value twice,
once for @node_name and once @name.  iotest 307 duly explodes.

Goes back to commit c62d24e906 "blockdev-nbd: Boxed argument type for
nbd-server-add" (v5.0.0).  Got moved from qmp_nbd_server_add() to
nbd_export_create() (commit 56ee86261e), then copied back (commit
b6076afcab).  Commit 8675cbd68b "nbd: Utilize QAPI_CLONE for type
conversion" (v5.2.0) cleaned up the copy in qmp_nbd_server_add()
noting

    Second, our assignment to arg->name is fishy: the generated QAPI code
    for qapi_free_NbdServerAddOptions does not visit arg->name if
    arg->has_name is false, but if it DID visit it, we would have
    introduced a double-free situation when arg is finally freed.

Exactly.  However, the copy in nbd_export_create() remained dirty.

Clean it up.  Since the value stored in member @name is not actually
used outside this function, use a local variable instead of modifying
the QAPI object.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-block@nongnu.org
Message-Id: <20221104160712.3005652-10-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>


  Commit: 54fde4ff0621c22b15cbaaa3c74301cc0dbd1c9e
      
https://github.com/qemu/qemu/commit/54fde4ff0621c22b15cbaaa3c74301cc0dbd1c9e
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M block/block-backend.c
    M block/copy-before-write.c
    M block/dirty-bitmap.c
    M block/export/export.c
    M block/export/vduse-blk.c
    M block/gluster.c
    M block/monitor/block-hmp-cmds.c
    M block/qapi-sysemu.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/quorum.c
    M block/rbd.c
    M block/ssh.c
    M blockdev-nbd.c
    M blockdev.c
    M blockjob.c
    M monitor/hmp-cmds.c
    M qemu-img.c
    M qemu-nbd.c
    M scripts/qapi/schema.py
    M ui/cocoa.m

  Log Message:
  -----------
  qapi block: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/block*.json.

Said commit explains the transformation in more detail.

There is one instance of the invariant violation mentioned there:
qcow2_signal_corruption() passes false, "" when node_name is an empty
string.  Take care to pass NULL then.

The previous two commits cleaned up two more.

Additionally, helper bdrv_latency_histogram_stats() loses its output
parameters and returns a value instead.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-11-armbru@redhat.com>
[Fixes for #ifndef LIBRBD_SUPPORTS_ENCRYPTION and MacOS squashed in]


  Commit: 8de69efab1009d374c7f01d2536797ea009ee796
      
https://github.com/qemu/qemu/commit/8de69efab1009d374c7f01d2536797ea009ee796
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M chardev/char-file.c
    M chardev/char-socket.c
    M chardev/char-udp.c
    M chardev/char.c
    M scripts/qapi/schema.py
    M tests/unit/test-char.c

  Log Message:
  -----------
  qapi chardev: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/char.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-12-armbru@redhat.com>


  Commit: 16110c8b366c66e4ac4c85783385b4b346e331e7
      
https://github.com/qemu/qemu/commit/16110c8b366c66e4ac4c85783385b4b346e331e7
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M crypto/block-luks.c
    M scripts/qapi/schema.py
    M tests/unit/test-crypto-block.c

  Log Message:
  -----------
  qapi crypto: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/crypto.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Daniel P. Berrangé" <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-13-armbru@redhat.com>


  Commit: d4f8bdc75371c4c71bae9e0405e342083d8d1c64
      
https://github.com/qemu/qemu/commit/d4f8bdc75371c4c71bae9e0405e342083d8d1c64
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M dump/dump.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi dump: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/dump.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-14-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: 107111bf6f8165f333ff934c5f482818572874ce
      
https://github.com/qemu/qemu/commit/107111bf6f8165f333ff934c5f482818572874ce
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M job-qmp.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi job: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/job.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: John Snow <jsnow@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20221104160712.3005652-15-armbru@redhat.com>


  Commit: fe8ac1fa49a2aa2c6badf26c6fbed5720d3f61f9
      
https://github.com/qemu/qemu/commit/fe8ac1fa49a2aa2c6badf26c6fbed5720d3f61f9
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/core/machine-hmp-cmds.c
    M hw/core/machine-qmp-cmds.c
    M hw/core/machine.c
    M hw/core/numa.c
    M hw/mem/pc-dimm.c
    M hw/nvram/fw_cfg.c
    M hw/virtio/virtio-mem-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M scripts/qapi/schema.py
    M target/arm/monitor.c
    M target/i386/cpu-sysemu.c
    M target/i386/cpu.c
    M target/s390x/cpu_models_sysemu.c

  Log Message:
  -----------
  qapi machine: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/machine*.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Eduardo Habkost <eduardo@habkost.net>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Yanan Wang <wangyanan55@huawei.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-16-armbru@redhat.com>


  Commit: 720a252c2651b1b701632d407d34044e844d0e31
      
https://github.com/qemu/qemu/commit/720a252c2651b1b701632d407d34044e844d0e31
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M migration/block-dirty-bitmap.c
    M migration/colo.c
    M migration/migration.c
    M monitor/hmp-cmds.c
    M monitor/misc.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi migration: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/migration.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Juan Quintela <quintela@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-17-armbru@redhat.com>


  Commit: 9492718b7c00c0a16e2ce834752b8c200e3217d1
      
https://github.com/qemu/qemu/commit/9492718b7c00c0a16e2ce834752b8c200e3217d1
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M include/monitor/monitor.h
    M monitor/hmp-cmds.c
    M monitor/misc.c
    M monitor/qmp-cmds.c
    M scripts/qapi/schema.py
    M softmmu/vl.c
    M util/qemu-config.c

  Log Message:
  -----------
  qapi misc: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/misc.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20221104160712.3005652-18-armbru@redhat.com>


  Commit: 7480874a69b17000cd10a2f97dbe51580ec44a96
      
https://github.com/qemu/qemu/commit/7480874a69b17000cd10a2f97dbe51580ec44a96
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/net/virtio-net.c
    M monitor/hmp-cmds.c
    M net/announce.c
    M net/hub.c
    M net/l2tpv3.c
    M net/net.c
    M net/slirp.c
    M net/socket.c
    M net/tap-win32.c
    M net/tap.c
    M net/vhost-vdpa.c
    M net/vmnet-host.c
    M net/vmnet-shared.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi net: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/net.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-19-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[Fixes for MacOS squashed in]


  Commit: 0846aaf77cfded0cab5dfc23715f0ebb03e5289a
      
https://github.com/qemu/qemu/commit/0846aaf77cfded0cab5dfc23715f0ebb03e5289a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/pci/pci.c
    M monitor/hmp-cmds.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi pci: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/pci.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-20-armbru@redhat.com>


  Commit: 047f2ca1cec9cdb226f4eac7e672f753089a42ee
      
https://github.com/qemu/qemu/commit/047f2ca1cec9cdb226f4eac7e672f753089a42ee
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/acpi/memory_hotplug.c
    M hw/core/qdev.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_drc.c
    M qom/qom-qmp-cmds.c
    M scripts/qapi/schema.py
    M stubs/qdev.c
    M tests/qtest/fuzz/qos_fuzz.c

  Log Message:
  -----------
  qapi qdev qom: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/qdev.json and
qapi/qom.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Daniel P. Berrangé <berrange@redhat.com>
Cc: Eduardo Habkost <eduardo@habkost.net>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-21-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: d01c00463fa70ff87ac40d5d3c39acd805488e69
      
https://github.com/qemu/qemu/commit/d01c00463fa70ff87ac40d5d3c39acd805488e69
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M replay/replay-debugging.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi replay: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/replay.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-22-armbru@redhat.com>


  Commit: 05e074886052acccb65f7df73ae4bbe7923e01bc
      
https://github.com/qemu/qemu/commit/05e074886052acccb65f7df73ae4bbe7923e01bc
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/net/rocker/rocker_of_dpa.c
    M monitor/hmp-cmds.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi rocker: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/rocker.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-23-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: 0ccc2c92ebee7a2563e6615b0f7bae0a56a48dad
      
https://github.com/qemu/qemu/commit/0ccc2c92ebee7a2563e6615b0f7bae0a56a48dad
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M scripts/qapi/schema.py
    M softmmu/runstate.c

  Log Message:
  -----------
  qapi run-state: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/run-state.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Drop a superfluous conditional around
qapi_free_GuestPanicInformation() while there.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-24-armbru@redhat.com>


  Commit: 1dde96d65fcfd44b4097cdbbad21d2e40167aa1c
      
https://github.com/qemu/qemu/commit/1dde96d65fcfd44b4097cdbbad21d2e40167aa1c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M monitor/qmp-cmds.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi stats: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/stats.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Mark Kanda <mark.kanda@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-25-armbru@redhat.com>


  Commit: ced2939685bb306431c2ffb1620460dfb6093a1a
      
https://github.com/qemu/qemu/commit/ced2939685bb306431c2ffb1620460dfb6093a1a
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M backends/tpm/tpm_passthrough.c
    M monitor/hmp-cmds.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi tpm: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/tpm.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20221104160712.3005652-26-armbru@redhat.com>


  Commit: 238e9202a25bbac9dfc3cfc2c87a3c095cb2268c
      
https://github.com/qemu/qemu/commit/238e9202a25bbac9dfc3cfc2c87a3c095cb2268c
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M blockdev.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi transaction: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/transaction.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

In qmp_transaction(), we can't just drop parameter @has_props, since
it's used to track whether @props needs to be freed.  Replace it by a
local variable.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-27-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: 3f41a3adb4aaaeea45c761edca9269dbd53ec5d9
      
https://github.com/qemu/qemu/commit/3f41a3adb4aaaeea45c761edca9269dbd53ec5d9
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M monitor/hmp-cmds.c
    M scripts/qapi/schema.py
    M ui/console.c
    M ui/input.c
    M ui/spice-core.c
    M ui/vnc.c

  Log Message:
  -----------
  qapi ui: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/ui.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20221104160712.3005652-28-armbru@redhat.com>


  Commit: 41462e41063c019df13e52735eae7197205a4b67
      
https://github.com/qemu/qemu/commit/41462e41063c019df13e52735eae7197205a4b67
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M hw/virtio/virtio.c
    M monitor/hmp-cmds.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi virtio: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qapi/virtio.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-29-armbru@redhat.com>


  Commit: 91eab32a3fcc14d3243cbd1c97f022796d4063e6
      
https://github.com/qemu/qemu/commit/91eab32a3fcc14d3243cbd1c97f022796d4063e6
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/commands.c
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi qga: Elide redundant has_FOO in generated C

The has_FOO for pointer-valued FOO are redundant, except for arrays.
They are also a nuisance to work with.  Recent commit "qapi: Start to
elide redundant has_FOO in generated C" provided the means to elide
them step by step.  This is the step for qga/qapi-schema.json.

Said commit explains the transformation in more detail.  The invariant
violations mentioned there do not occur here.

Cc: Michael Roth <michael.roth@amd.com>
Cc: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221104160712.3005652-30-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


  Commit: 5efb40d6571457c3cc35b7a91088cc2fceee5763
      
https://github.com/qemu/qemu/commit/5efb40d6571457c3cc35b7a91088cc2fceee5763
  Author: Markus Armbruster <armbru@redhat.com>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M scripts/qapi/schema.py

  Log Message:
  -----------
  qapi: Drop temporary logic to support conversion step by step

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221104160712.3005652-31-armbru@redhat.com>


  Commit: ae2b87341b5ddb0dcb1b3f2d4f586ef18de75873
      
https://github.com/qemu/qemu/commit/ae2b87341b5ddb0dcb1b3f2d4f586ef18de75873
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2022-12-14 (Wed, 14 Dec 2022)

  Changed paths:
    M audio/alsaaudio.c
    M audio/audio.c
    M audio/audio_legacy.c
    M audio/ossaudio.c
    M audio/paaudio.c
    M audio/sndioaudio.c
    M audio/wavaudio.c
    M backends/tpm/tpm_passthrough.c
    M block/block-backend.c
    M block/copy-before-write.c
    M block/dirty-bitmap.c
    M block/export/export.c
    M block/export/vduse-blk.c
    M block/gluster.c
    M block/monitor/block-hmp-cmds.c
    M block/qapi-sysemu.c
    M block/qapi.c
    M block/qcow.c
    M block/qcow2.c
    M block/qed.c
    M block/quorum.c
    M block/rbd.c
    M block/ssh.c
    M blockdev-nbd.c
    M blockdev.c
    M blockjob.c
    M chardev/char-file.c
    M chardev/char-socket.c
    M chardev/char-udp.c
    M chardev/char.c
    M crypto/block-luks.c
    M docs/devel/qapi-code-gen.rst
    M docs/devel/writing-monitor-commands.rst
    M dump/dump.c
    M hw/acpi/core.c
    M hw/acpi/cpu.c
    M hw/acpi/memory_hotplug.c
    M hw/core/machine-hmp-cmds.c
    M hw/core/machine-qmp-cmds.c
    M hw/core/machine.c
    M hw/core/numa.c
    M hw/core/qdev.c
    M hw/mem/pc-dimm.c
    M hw/net/rocker/rocker_of_dpa.c
    M hw/net/virtio-net.c
    M hw/nvram/fw_cfg.c
    M hw/pci/pci.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_drc.c
    M hw/virtio/virtio-mem-pci.c
    M hw/virtio/virtio-pmem-pci.c
    M hw/virtio/virtio.c
    M include/monitor/monitor.h
    M job-qmp.c
    M migration/block-dirty-bitmap.c
    M migration/colo.c
    M migration/migration.c
    M monitor/hmp-cmds.c
    M monitor/misc.c
    M monitor/qmp-cmds.c
    M nbd/server.c
    M net/announce.c
    M net/hub.c
    M net/l2tpv3.c
    M net/net.c
    M net/slirp.c
    M net/socket.c
    M net/tap-win32.c
    M net/tap.c
    M net/vhost-vdpa.c
    M net/vmnet-host.c
    M net/vmnet-shared.c
    M qemu-img.c
    M qemu-nbd.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M qga/commands.c
    M qom/qom-qmp-cmds.c
    M replay/replay-debugging.c
    M scripts/qapi/commands.py
    M scripts/qapi/events.py
    M scripts/qapi/gen.py
    M scripts/qapi/schema.py
    M scripts/qapi/types.py
    M scripts/qapi/visit.py
    M softmmu/runstate.c
    M softmmu/vl.c
    M stubs/qdev.c
    M target/arm/monitor.c
    M target/i386/cpu-sysemu.c
    M target/i386/cpu.c
    M target/s390x/cpu_models_sysemu.c
    M tests/qtest/fuzz/qos_fuzz.c
    M tests/qtest/qmp-cmd-test.c
    M tests/unit/test-char.c
    M tests/unit/test-crypto-block.c
    M tests/unit/test-qmp-cmds.c
    M tests/unit/test-qmp-event.c
    M tests/unit/test-qobject-input-visitor.c
    M tests/unit/test-qobject-output-visitor.c
    M tests/unit/test-visitor-serialization.c
    M ui/cocoa.m
    M ui/console.c
    M ui/input.c
    M ui/spice-core.c
    M ui/vnc.c
    M util/qemu-config.c

  Log Message:
  -----------
  Merge tag 'pull-qapi-2022-12-14-v2' of https://repo.or.cz/qemu/armbru into 
staging

QAPI patches patches for 2022-12-14

# gpg: Signature made Wed 14 Dec 2022 19:14:34 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-qapi-2022-12-14-v2' of https://repo.or.cz/qemu/armbru: (30 commits)
  qapi: Drop temporary logic to support conversion step by step
  qapi qga: Elide redundant has_FOO in generated C
  qapi virtio: Elide redundant has_FOO in generated C
  qapi ui: Elide redundant has_FOO in generated C
  qapi transaction: Elide redundant has_FOO in generated C
  qapi tpm: Elide redundant has_FOO in generated C
  qapi stats: Elide redundant has_FOO in generated C
  qapi run-state: Elide redundant has_FOO in generated C
  qapi rocker: Elide redundant has_FOO in generated C
  qapi replay: Elide redundant has_FOO in generated C
  qapi qdev qom: Elide redundant has_FOO in generated C
  qapi pci: Elide redundant has_FOO in generated C
  qapi net: Elide redundant has_FOO in generated C
  qapi misc: Elide redundant has_FOO in generated C
  qapi migration: Elide redundant has_FOO in generated C
  qapi machine: Elide redundant has_FOO in generated C
  qapi job: Elide redundant has_FOO in generated C
  qapi dump: Elide redundant has_FOO in generated C
  qapi crypto: Elide redundant has_FOO in generated C
  qapi chardev: Elide redundant has_FOO in generated C
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/5204b499a6ca...ae2b87341b5d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]