All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Lukas Straub" <lukasstraub2@web.de>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Peter Xu" <peterx@redhat.com>, "Eric Blake" <eblake@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Cédric Le Goater" <clg@redhat.com>,
	qemu-block@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	"Alex Williamson" <alex@shazbot.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kashyap Chamarthy" <kchamart@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>
Subject: Re: [PATCH 3/8] qapi: add "Details:" disambiguation marker
Date: Fri, 20 Mar 2026 14:45:48 +0100	[thread overview]
Message-ID: <87tsua62cz.fsf@pond.sub.org> (raw)
In-Reply-To: <20260316182608.148628-4-jsnow@redhat.com> (John Snow's message of "Mon, 16 Mar 2026 14:26:02 -0400")

John Snow <jsnow@redhat.com> writes:

> When a documentation block consists only of plaintext, there is nothing
> to semantically differentiate the "intro" from the "details"
> section. For the purposes of the inliner, the intro section is likely to
> be dropped while the details section will be merged onto the end of the
> parent's details section.
>
> When the delineation between "intro" and "details" is not clear because
> there is no intervening "members", "features", "errors", "returns",
> "TODO", or "Since" section, the parser assumes the entire text section
> is an "intro" section. This may not always be semantically true, so this
> patch clarifies certain sections explicitly as "details" sections by
> using an empty "Details:" marker.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  qapi/block-core.json   | 3 +++
>  qapi/machine.json      | 2 +-
>  qapi/migration.json    | 8 ++++++--
>  qapi/net.json          | 2 +-
>  qapi/qom.json          | 4 ++++
>  qapi/yank.json         | 2 +-
>  scripts/qapi/parser.py | 8 ++++++++
>  7 files changed, 24 insertions(+), 5 deletions(-)

Missing: update to docs/devel/qapi-code-gen.rst.  Suggest to put in a
FIXME, so we don't forget.

>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index f8d446b3d6e..c5ff15ae7a1 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -5007,6 +5007,9 @@
>  # @blockdev-reopen:
>  #
>  # Reopens one or more block devices using the given set of options.
> +#
> +# Details:
> +#
>  # Any option not specified will be reset to its default value
>  # regardless of its previous status.  If an option cannot be changed
>  # or a particular driver does not support reopening then the command

Rendered documentation before the patch:

    Command blockdev-reopen (Since: 6.1)

       Reopens one or more block devices using the given set of options.
       Any option not specified will be reset to its default value
       regardless of its previous status.  If an option cannot be changed
       or a particular driver does not support reopening then the command
       will return an error.  All devices in the list are reopened in one
       transaction, so if one of them fails then the whole transaction is
       cancelled.

       [...]

       Unlike with "blockdev-add", the "backing" option must always be
       present unless the node being reopened does not have a backing file
       and its image does not have a default backing file name as part of
       its metadata.

       Arguments:
          * options ([BlockdevOptions]) -- Not documented

The command's single argument is undocumented, and the doc generator
papered over this (sadly common defect) by splicing in this "Not
documented" description.

Aside: why not boxed, like blockdev-add?  Design mistake?

The patch moves the splice point.  Not wrong, but we should really fill
in the document gap instead.

> diff --git a/qapi/machine.json b/qapi/machine.json
> index 685e4e29b87..bc2279b2526 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1259,7 +1259,7 @@
>  # Return the amount of initially allocated and present hotpluggable
>  # (if enabled) memory in bytes.
>  #
> -# TODO: This line is a hack to separate the example from the body
> +# Details:

This replaces a hack by a proper solution.  More of the same below, not
mentioning this again.

>  #
>  # .. qmp-example::
>  #
> diff --git a/qapi/migration.json b/qapi/migration.json
> index 7134d4ce47e..558b4f145ed 100644
> --- a/qapi/migration.json
> +++ b/qapi/migration.json
> @@ -1633,7 +1633,7 @@
>  #
>  # Query replication status while the vm is running.
>  #
> -# TODO: This line is a hack to separate the example from the body
> +# Details:
>  #
>  # .. qmp-example::
>  #
> @@ -1651,6 +1651,8 @@
>  #
>  # Xen uses this command to notify replication to trigger a checkpoint.
>  #
> +# Details:
> +#
>  # .. qmp-example::
>  #
>  #     -> { "execute": "xen-colo-do-checkpoint" }

No change to generated documentation.  I guess this is needed to avoid
the yelping added in the next patch.  Correct?

> @@ -1687,7 +1689,7 @@
>  #
>  # Query COLO status while the vm is running.
>  #
> -# TODO: This line is a hack to separate the example from the body
> +# Details:
>  #
>  # .. qmp-example::
>  #
> @@ -1724,6 +1726,8 @@
>  #
>  # Pause a migration.  Currently it only supports postcopy.
>  #
> +# Details:
> +#
>  # .. qmp-example::
>  #
>  #     -> { "execute": "migrate-pause" }

Likewise?

> diff --git a/qapi/net.json b/qapi/net.json
> index 118bd349651..c011d6dc1a9 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -1070,7 +1070,7 @@
>  # switches.  This can be useful when network bonds fail-over the
>  # active slave.
>  #
> -# TODO: This line is a hack to separate the example from the body
> +# Details:
>  #
>  # .. qmp-example::
>  #
> diff --git a/qapi/qom.json b/qapi/qom.json
> index 1b47abd44e9..568b7d4b997 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -777,6 +777,8 @@
>  #
>  # Properties for memory-backend-shm objects.
>  #
> +# Details:
> +#
>  # This memory backend supports only shared memory, which is the
>  # default.
>  #

Rendered documentation changes from

    Object MemoryBackendShmProperties (Since: 9.1)
        Availability: CONFIG_POSIX

       Properties for memory-backend-shm objects.

       This memory backend supports only shared memory, which is the
       default.

       Members:
          * The members of MemoryBackendProperties.

to

    Object MemoryBackendShmProperties (Since: 9.1)
        Availability: CONFIG_POSIX

       Properties for memory-backend-shm objects.

       Members:
          * The members of MemoryBackendProperties.

       This memory backend supports only shared memory, which is the
       default.

Feels like a wash.

I guess we need a "Details:" somewhere to avoid yelping.  Correct?

> @@ -792,6 +794,8 @@
>  #
>  # Properties for memory-backend-epc objects.
>  #
> +# Details:
> +#
>  # The @merge boolean option is false by default with epc
>  #
>  # The @dump boolean option is false by default with epc

Similar change to rendered documentation, same request to confirm
yelping.

> diff --git a/qapi/yank.json b/qapi/yank.json
> index f3cd5c15d60..2854a8a9d2a 100644
> --- a/qapi/yank.json
> +++ b/qapi/yank.json
> @@ -104,7 +104,7 @@
>  #
>  # Query yank instances.  See `YankInstance` for more information.
>  #
> -# TODO: This line is a hack to separate the example from the body
> +# Details:
>  #
>  # .. qmp-example::
>  #

[Skipping the Python code in my first pass...]

I'd be tempted to split the patch into hack replacement and yelping
avoidance.



  reply	other threads:[~2026-03-20 13:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 18:25 [PATCH 0/8] qapi: enforce section ordering John Snow
2026-03-16 18:26 ` [PATCH 1/8] qapi: differentiate "intro" and "details" sections John Snow
2026-03-20 12:24   ` Markus Armbruster
2026-03-20 17:20     ` John Snow
2026-03-23  8:15       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 2/8] qapi: prohibit 'details' sections between tagged sections John Snow
2026-03-20 12:46   ` Markus Armbruster
2026-03-20 17:40     ` John Snow
2026-03-23  8:41       ` Markus Armbruster
2026-03-20 13:46   ` Markus Armbruster
2026-03-20 17:42     ` John Snow
2026-03-16 18:26 ` [PATCH 3/8] qapi: add "Details:" disambiguation marker John Snow
2026-03-20 13:45   ` Markus Armbruster [this message]
2026-03-20 18:25     ` John Snow
2026-03-23  8:55       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 4/8] qapi: detect potentially semantically ambiguous intro paragraphs John Snow
2026-03-20 13:51   ` Markus Armbruster
2026-03-20 18:26     ` John Snow
2026-03-16 18:26 ` [PATCH 5/8] qapi: re-order QAPI doc block sections John Snow
2026-03-20 14:11   ` Markus Armbruster
2026-03-20 18:27     ` John Snow
2026-03-16 18:26 ` [PATCH 6/8] qapi: enforce doc block section ordering John Snow
2026-03-20 14:13   ` Markus Armbruster
2026-03-20 18:28     ` John Snow
2026-03-23  8:56       ` Markus Armbruster
2026-03-16 18:26 ` [PATCH 7/8] qapi: re-order 'since' sections to always be last John Snow
2026-03-20 14:23   ` Markus Armbruster
2026-03-20 20:47     ` John Snow
2026-03-16 18:26 ` [PATCH 8/8] qapi: enforce strict positioning for "Since:" section John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tsua62cz.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alex@shazbot.org \
    --cc=anisinha@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=jsnow@redhat.com \
    --cc=kchamart@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lukasstraub2@web.de \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=stefanha@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.