[PATCH v2 00/44] qapi: convert trivial intro sections

John Snow posted 44 patches 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260723044805.527643-1-jsnow@redhat.com
Maintainers: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@mailo.com>, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, zhenwei pi <zhenwei.pi@linux.dev>, Jonathan Cameron <jic23@kernel.org>, John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Zhao Liu <zhao1.liu@intel.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Jason Wang <jasowangio@gmail.com>, "Alex Bennée" <alex.bennee@linaro.org>, Jiri Pirko <jiri@resnulli.us>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Stefan Hajnoczi <stefanha@redhat.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>, Lukas Straub <lukasstraub2@web.de>
qapi/accelerator.json    |  18 +-
qapi/acpi-hest.json      |   4 +-
qapi/acpi.json           |  15 +-
qapi/audio.json          |  88 ++----
qapi/authz.json          |  21 +-
qapi/block-core.json     | 646 ++++++++++++++++-----------------------
qapi/block-export.json   |  87 +++---
qapi/block.json          |  58 ++--
qapi/char.json           |  90 ++----
qapi/common.json         |  36 +--
qapi/compat.json         |   6 +-
qapi/control.json        |  30 +-
qapi/crypto.json         | 118 +++----
qapi/cryptodev.json      |  18 +-
qapi/cxl.json            | 128 ++++----
qapi/dump.json           |  24 +-
qapi/ebpf.json           |  14 +-
qapi/error.json          |   3 +-
qapi/introspect.json     |  45 +--
qapi/job.json            |  18 +-
qapi/machine-common.json |  19 +-
qapi/machine-s390x.json  |  20 +-
qapi/machine.json        | 261 ++++++----------
qapi/migration.json      | 201 +++++-------
qapi/misc-arm.json       |  15 +-
qapi/misc-i386.json      |  52 ++--
qapi/misc.json           |  74 ++---
qapi/net.json            | 101 +++---
qapi/pci.json            |  27 +-
qapi/qdev.json           |  23 +-
qapi/qom.json            | 138 +++------
qapi/replay.json         |  45 ++-
qapi/rocker.json         |  39 +--
qapi/run-state.json      | 120 +++-----
qapi/sockets.json        |  31 +-
qapi/stats.json          |  34 +--
qapi/tpm.json            |  29 +-
qapi/trace.json          |  12 +-
qapi/transaction.json    |  14 +-
qapi/uefi.json           |   5 +-
qapi/ui.json             | 215 +++++--------
qapi/vfio.json           |  19 +-
qapi/virtio.json         |  91 +++---
qapi/yank.json           |  25 +-
44 files changed, 1165 insertions(+), 1912 deletions(-)
[PATCH v2 00/44] qapi: convert trivial intro sections
Posted by John Snow 1 day ago
GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/2699067787

Hi, this patchset converts trivial "introductory" sections in the QAPI
documentation to use the new, explicit intro section syntax.

This is being done primarily for the benefit of the forthcoming
"inliner", a feature for the rendered HTML QMP documentation that
seeks to "inline" QMP command argument documentation into the argument
list for each command.

There are two main motives here:

(1) We want the split between the "introduction" and "details"
    sections to be mechanically obvious, so that auto-generated or
    inlined documentation has a well-defined, obvious spot to go.

(2) We do not want to inline irrelevant, introductory text describing
    structures to be copied into command documentation.

This patchset tackles "trivial" conversions: cases where the
introduction is only a single paragraph and is immediately followed by
a tagged section, the end of the documentation block, or some other
pre-existing syntactical delineation.

Future patches that may require more scrutiny will handle the
remaining conversions - I think this is enough for today, don't you?

John Snow (44):
  qapi: convert intro sections for error.json
  qapi: convert intro sections for acpi-hest.json
  qapi: convert intro sections for ebpf.json
  qapi: convert intro sections for uefi.json
  qapi: convert trivial intro sections for compat.json
  qapi: convert intro sections for vfio.json
  qapi: convert intro sections for trace.json
  qapi: convert trivial intro sections for misc-arm.json
  qapi: convert intro sections for cryptodev.json
  qapi: convert intro sections for machine-common.json
  qapi: convert intro sections for accelerator.json
  qapi: convert intro sections for authz.json
  qapi: convert trivial intro sections for yank.json
  qapi: convert intro sections for replay.json
  qapi: convert trivial intro sections for machine-s390x.json
  qapi: convert trivial intro sections for acpi.json
  qapi: convert intro sections for tpm.json
  qapi: convert trivial intro sections for qdev.json
  qapi: convert trivial intro sections for control.json
  qapi: convert intro sections for dump.json
  qapi: convert intro sections for common.json
  qapi: convert intro sections for sockets.json
  qapi: convert trivial intro sections for transaction.json
  qapi: convert trivial intro sections for stats.json
  qapi: convert trivial intro sections for job.json
  qapi: convert intro sections for pci.json
  qapi: convert trivial intro sections for introspect.json
  qapi: convert intro sections for rocker.json
  qapi: convert trivial intro sections for misc-i386.json
  qapi: convert trivial intro sections for block-export.json
  qapi: convert intro sections for audio.json
  qapi: convert trivial intro sections for block.json
  qapi: convert trivial intro sections for misc.json
  qapi: convert trivial intro sections for crypto.json
  qapi: convert intro sections for cxl.json
  qapi: convert trivial intro sections for run-state.json
  qapi: convert intro sections for char.json
  qapi: convert intro sections for virtio.json
  qapi: convert trivial intro sections for net.json
  qapi: convert trivial intro sections for qom.json
  qapi: convert trivial intro sections for ui.json
  qapi: convert trivial intro sections for migration.json
  qapi: convert trivial intro sections for machine.json
  qapi: convert trivial intro sections for block-core.json

 qapi/accelerator.json    |  18 +-
 qapi/acpi-hest.json      |   4 +-
 qapi/acpi.json           |  15 +-
 qapi/audio.json          |  88 ++----
 qapi/authz.json          |  21 +-
 qapi/block-core.json     | 646 ++++++++++++++++-----------------------
 qapi/block-export.json   |  87 +++---
 qapi/block.json          |  58 ++--
 qapi/char.json           |  90 ++----
 qapi/common.json         |  36 +--
 qapi/compat.json         |   6 +-
 qapi/control.json        |  30 +-
 qapi/crypto.json         | 118 +++----
 qapi/cryptodev.json      |  18 +-
 qapi/cxl.json            | 128 ++++----
 qapi/dump.json           |  24 +-
 qapi/ebpf.json           |  14 +-
 qapi/error.json          |   3 +-
 qapi/introspect.json     |  45 +--
 qapi/job.json            |  18 +-
 qapi/machine-common.json |  19 +-
 qapi/machine-s390x.json  |  20 +-
 qapi/machine.json        | 261 ++++++----------
 qapi/migration.json      | 201 +++++-------
 qapi/misc-arm.json       |  15 +-
 qapi/misc-i386.json      |  52 ++--
 qapi/misc.json           |  74 ++---
 qapi/net.json            | 101 +++---
 qapi/pci.json            |  27 +-
 qapi/qdev.json           |  23 +-
 qapi/qom.json            | 138 +++------
 qapi/replay.json         |  45 ++-
 qapi/rocker.json         |  39 +--
 qapi/run-state.json      | 120 +++-----
 qapi/sockets.json        |  31 +-
 qapi/stats.json          |  34 +--
 qapi/tpm.json            |  29 +-
 qapi/trace.json          |  12 +-
 qapi/transaction.json    |  14 +-
 qapi/uefi.json           |   5 +-
 qapi/ui.json             | 215 +++++--------
 qapi/vfio.json           |  19 +-
 qapi/virtio.json         |  91 +++---
 qapi/yank.json           |  25 +-
 44 files changed, 1165 insertions(+), 1912 deletions(-)

-- 
2.55.0

Re: [PATCH v2 00/44] qapi: convert trivial intro sections
Posted by Markus Armbruster 15 hours ago
John Snow <jsnow@redhat.com> writes:

> GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/2699067787
>
> Hi, this patchset converts trivial "introductory" sections in the QAPI
> documentation to use the new, explicit intro section syntax.
>
> This is being done primarily for the benefit of the forthcoming
> "inliner", a feature for the rendered HTML QMP documentation that
> seeks to "inline" QMP command argument documentation into the argument
> list for each command.
>
> There are two main motives here:
>
> (1) We want the split between the "introduction" and "details"
>     sections to be mechanically obvious, so that auto-generated or
>     inlined documentation has a well-defined, obvious spot to go.
>
> (2) We do not want to inline irrelevant, introductory text describing
>     structures to be copied into command documentation.

docs/devel/qapi-code-gen.rst until recently:

    Definition documentation starts with a line naming the definition,
    followed by an optional overview, a description of each argument (for
    commands and events), member (for structs and unions), branch (for
    alternates), or value (for enums), a description of each feature (if
    any), and finally optional tagged sections.

Recent commit ebb49d4bb6 (qapi: add doc comment "Intro" section parsing)
changed it to

    Definition documentation starts with a description naming the
    definition with an optional indented overview, a description of each
    argument (for commands and events), member (for structs and unions),
    branch (for alternates), or value (for enums), a description of each
    feature (if any), and finally optional tagged sections.

It didn't actually update the schema for this change.  This series does,
but only where it's "trivial":

> This patchset tackles "trivial" conversions: cases where the
> introduction is only a single paragraph and is immediately followed by
> a tagged section, the end of the documentation block, or some other
> pre-existing syntactical delineation.

I see the following right after conversions:

* A member description "# @name: ..."

* A "Features:" line

* A tagged section like "Returns: ...", "Since: ..."

End of documentation block ("##") also makes sense, but doesn't actually
occur, because we always have a Since: somewhere after the first
paragraph.

Converting single first paragraps is mechanical.  For it to be correct,
this single paragraph must actually be the overview, and not some other
crap.  I expect it to be almost always overview.  Not sure how to best
look for the exceptions.

When there's more than one paragraph, it could still all be overview.
But the risk of "other crap" is higher.  For instance:

    ##
    # @SecretProperties:
    #
    # Properties for secret objects.
    #
    # Either @data or @file must be provided, but not both.
    #
    # @data: the associated with the secret from
    #
    # @file: the filename to load the data associated with the secret from
    #
    # Since: 2.6
    ##

Two paragraphs, only the first is "overview".

That's why you leave checking and disentangling multiple paragraphs for
later.  Makes sense.

> Future patches that may require more scrutiny will handle the
> remaining conversions - I think this is enough for today, don't you?

Oh yes, it is.