[PATCH v1 00/16] qapi examples fixes and rfc for another generator

Victor Toso posted 16 patches 3 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220830161545.84198-1-victortoso@redhat.com
Maintainers: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Yanan Wang <wangyanan55@huawei.com>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Jason Wang <jasowang@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Jiri Pirko <jiri@resnulli.us>, Gerd Hoffmann <kraxel@redhat.com>, Michael Roth <michael.roth@amd.com>
qapi/block-core.json         |  46 ++++-----
qapi/dump.json               |   1 +
qapi/machine.json            |   8 +-
qapi/migration.json          |  83 +++++++++++++--
qapi/net.json                |   2 +-
qapi/qdev.json               |   3 +-
qapi/rocker.json             |   3 +-
qapi/ui.json                 |   7 +-
scripts/qapi/dumpexamples.py | 194 +++++++++++++++++++++++++++++++++++
scripts/qapi/main.py         |   2 +
10 files changed, 304 insertions(+), 45 deletions(-)
create mode 100644 scripts/qapi/dumpexamples.py
[PATCH v1 00/16] qapi examples fixes and rfc for another generator
Posted by Victor Toso 3 years, 5 months ago
Hi,

I've been using the examples as a way to test the qapi-go proposal [0]
and I thought it would be neat to have a way to parse those examples and
regenerate them in a way that we could use for testing.

The first 10 patches are fixes to issues found when loading the Example
into python's json library.

Patches 11-15 are fixes to issues found when using those exampels in the
qapi-go module [1].

Patch 16 is the RFC for the generator used. If the idea is interesting,
I can rework it and add some qapi/qmp verification of the examples at
generation time with python-qemu-qmp [2].

[0] https://lists.nongnu.org/archive/html/qemu-devel/2022-06/msg03105.html
[1] https://gitlab.com/victortoso/qapi-go/-/tree/wip-v3/test
[2] https://gitlab.com/qemu-project/python-qemu-qmp

Cheers,
Victor

Victor Toso (16):
  qapi: fix example of query-ballon command
  qapi: fix example of query-vnc command
  qapi: fix example of query-spice command
  qapi: fix example of query-rocker-of-dpa-flows command
  qapi: fix example of query-dump-guest-memory-capability command
  qapi: fix example of query-blockstats command
  qapi: fix example of BLOCK_JOB_READY event
  qapi: fix example of NIC_RX_FILTER_CHANGED event
  qapi: fix example of DEVICE_UNPLUG_GUEST_ERROR event
  qapi: fix example of MEM_UNPLUG_ERROR event
  qapi: fix examples of blockdev-add with qcow2
  qapi: fix example of blockdev-add command
  qapi: fix example of query-hotpluggable-cpus command
  qapi: fix example of query-migrate command
  qapi: fix examples of events missing timestamp
  RFC: add a generator for qapi's examples

 qapi/block-core.json         |  46 ++++-----
 qapi/dump.json               |   1 +
 qapi/machine.json            |   8 +-
 qapi/migration.json          |  83 +++++++++++++--
 qapi/net.json                |   2 +-
 qapi/qdev.json               |   3 +-
 qapi/rocker.json             |   3 +-
 qapi/ui.json                 |   7 +-
 scripts/qapi/dumpexamples.py | 194 +++++++++++++++++++++++++++++++++++
 scripts/qapi/main.py         |   2 +
 10 files changed, 304 insertions(+), 45 deletions(-)
 create mode 100644 scripts/qapi/dumpexamples.py

-- 
2.37.2