[PATCH v3 00/10] Validate and test qapi examples

Victor Toso posted 10 patches 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230919201857.675913-1-victortoso@redhat.com
Maintainers: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>, Leonardo Bras <leobras@redhat.com>, Jason Wang <jasowang@redhat.com>, Jiri Pirko <jiri@resnulli.us>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Michael Roth <michael.roth@amd.com>
qapi/block-core.json         |  32 +++---
qapi/machine.json            |   2 +-
qapi/migration.json          |   6 +-
qapi/misc.json               |   2 +-
qapi/net.json                |   6 +-
qapi/rocker.json             |   3 +-
qapi/ui.json                 |   3 +-
scripts/qapi/dumpexamples.py | 208 +++++++++++++++++++++++++++++++++++
scripts/qapi/main.py         |   3 +-
9 files changed, 236 insertions(+), 29 deletions(-)
create mode 100644 scripts/qapi/dumpexamples.py
[PATCH v3 00/10] Validate and test qapi examples
Posted by Victor Toso 7 months, 1 week ago
Hi,

v2: https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg02383.html

- Sorry Markus, I kept the two last 'fix example' patches as I don't
  fully remember how we should go with it. Not taking them but taking
  the generator would be bad as we would fail the build.

- Removed the meson flag suggested by Philippe to take the pragma suggestion from Markus, the
  interesting diff is:

    --- a/scripts/qapi/dumpexamples.py
    +++ b/scripts/qapi/dumpexamples.py
    @@ -119,6 +119,10 @@ def parse_examples_of(self: QAPISchemaGenExamplesVisitor,

         assert(name in self.schema._entity_dict)
         obj = self.schema._entity_dict[name]
    +
    +    if not obj.info.pragma.doc_required:
    +        return
    +
         assert((obj.doc is not None))
         module_name = obj._module.name

  which avoid failures with tests that don't have any docs.

Cheers,
Victor

Victor Toso (10):
  qapi: fix example of get-win32-socket command
  qapi: fix example of dumpdtb command
  qapi: fix example of cancel-vcpu-dirty-limit command
  qapi: fix example of set-vcpu-dirty-limit command
  qapi: fix example of calc-dirty-rate command
  qapi: fix example of NETDEV_STREAM_CONNECTED event
  qapi: fix example of query-blockstats command
  qapi: fix example of query-rocker-of-dpa-flows command
  qapi: fix example of query-spice command
  qapi: scripts: add a generator for qapi's examples

 qapi/block-core.json         |  32 +++---
 qapi/machine.json            |   2 +-
 qapi/migration.json          |   6 +-
 qapi/misc.json               |   2 +-
 qapi/net.json                |   6 +-
 qapi/rocker.json             |   3 +-
 qapi/ui.json                 |   3 +-
 scripts/qapi/dumpexamples.py | 208 +++++++++++++++++++++++++++++++++++
 scripts/qapi/main.py         |   3 +-
 9 files changed, 236 insertions(+), 29 deletions(-)
 create mode 100644 scripts/qapi/dumpexamples.py

-- 
2.41.0
Re: [PATCH v3 00/10] Validate and test qapi examples
Posted by Markus Armbruster 7 months, 1 week ago
Victor Toso <victortoso@redhat.com> writes:

> Hi,
>
> v2: https://lists.gnu.org/archive/html/qemu-devel/2023-09/msg02383.html
>
> - Sorry Markus, I kept the two last 'fix example' patches as I don't
>   fully remember how we should go with it.

That's fine.

I see two sane alternatives:

1. Add suitable elision syntax.  Happy to discuss details, but I think
we should discuss my review of PATCH 10 before we complicate matters
further.

2. Decide we don't need elisions.  Delete the ones we have.  I'd like to
see an argument that the ones we have are not helpful enough to justfify
the effort to keep them.

>                                            Not taking them but taking
>   the generator would be bad as we would fail the build.

Understood.

[...]