From: Markus Armbruster <armbru@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, "Jason Wang" <jasowang@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Jiri Pirko" <jiri@resnulli.us>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
qemu-trivial@nongnu.org,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Peter Xu" <peterx@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Zhenwei Pi" <pizhenwei@bytedance.com>,
"Lukas Straub" <lukasstraub2@web.de>,
"Hanna Reitz" <hreitz@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>, "Eric Blake" <eblake@redhat.com>,
qemu-block@nongnu.org, "Mads Ynddal" <mads@ynddal.dk>
Subject: Re: [PATCH v5 2/4] docs, qapi: generate undocumented return sections
Date: Fri, 27 Jun 2025 14:30:08 +0200 [thread overview]
Message-ID: <877c0xl63z.fsf@pond.sub.org> (raw)
In-Reply-To: <20250626195337.2158250-3-jsnow@redhat.com> (John Snow's message of "Thu, 26 Jun 2025 15:53:35 -0400")
John Snow <jsnow@redhat.com> writes:
> This patch changes the qapidoc parser to generate stub Return value
> documentation for any command that has a return value but does not have
> a "Returns:" doc section.
>
> The stubs include just the type name, which will be rendered with a
> cross-reference link in the HTML output.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
Might want to briefly explain placement of the auto-generated return
value documentation.
The cover letter claims you implemented the placement I suggested:
1. If we have arguments, return goes right after them.
2. Else if we have errors, return goes right before them.
3. Else if we have features, return goes right before them.
4. Else return goes right after the intro (might require a few more TODO
hacks to terminate the intro).
This patch adds auto-generated return value documentation where we have
none.
The next patch replaces handwritten by auto-generated return value
documentation where these are at least as good. Moves the return value
docs in some cases.
Let's check placement. Skip to the end for a summary of findings.
First the additions (this patch):
* x-debug-query-block-graph
Title, intro, features, return
1. doesn't apply, 2. doesn't apply, 3. applies: return should go right
before features. It's afterwards. Unexpected.
* query-tpm
Title, intro, return, example
4. applies. Good.
* query-dirty-rate
Title, intro, arguments, return, examples
1. applies. Good.
* query-vcpu-dirty-limit
Title, intro, return, example
4. applies. Good.
* query-vm-generation-id
Title, intro, return
4. applies. Good.
* query-memory-size-summary
Title, intro, example, return
4. applies. Why is return after example here, and before example
elsewhere?
Turns out elsewhere we have Since: between intro and .. qmp-example::
terminating the intro. Slighly unusual, Since: more often the last in
the comment block).
Except for query-memory-size-summary, which does have Since: at the
very and, and uses the TODO hack instead to terminate the intro.
So, the placement algorithm works as intended here. We just need to
terminate the intro here as well.
* query-memory-devices
Title, intro, return, example
4. applies. Good.
* query-acpi-ospm-status
Title, intro, return, example
4. applies. Good.
* query-stats-schemas
Title, intro, arguments, return, note
1. applies. Good.
Check placement of moved returns (next patch):
* x-debug-block-dirty-bitmap-sha256
Title, intro, arguments, features, errors, return
1. applies: return should go right after arguments. Its at the end.
Unexpected.
* query-xen-replication-status
Title, intro, example, return
Return after example instead of before. This is just like
query-memory-size-summary: placement algorithm works as intended,
intro needs a terminator.
* query-colo-status
Title, intro, example, return
Likewise.
* query-machines
Title, intro, arguments, return, features, example
1. applies. Okay.
* query-balloon
Title, intro, errors, return, example
2. applies: return should go right before errors. It's afterwards.
Unexpected.
* query-hv-balloon-status-report
Title, intro, errors, return, example
Likewise.
* query-yank
Title, intro, example, return
Another one just like query-memory-size-summary: placement algorithm
works as intended, intro needs a terminator.
* query-sev-capabilities
Title, intro, errors, return, example
Like query-ballon.
* x-query-virtio-queue-element
Title, intro, arguments, return, features, example
1. applies. Good.
Summary of findings:
1. If we have arguments, return goes right after them.
Works as intended, except for x-debug-block-dirty-bitmap-sha256.
Odd.
2. Else if we have errors, return goes right before them.
You seem to place it afterwards instead.
3. Else if we have features, return goes right before them.
You seem to place it afterwards instead.
4. Else return goes right after the intro (might require a few more TODO
hacks to terminate the intro).
Yes, we need several of them.
next prev parent reply other threads:[~2025-06-27 12:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 19:53 [PATCH v5 0/4] qapi: add auto-generated return docs John Snow
2025-06-26 19:53 ` [PATCH v5 1/4] docs/qapi-domain: add return-nodesc John Snow
2025-06-26 19:53 ` [PATCH v5 2/4] docs, qapi: generate undocumented return sections John Snow
2025-06-27 12:30 ` Markus Armbruster [this message]
2025-06-26 19:53 ` [PATCH v5 3/4] qapi: remove trivial "Returns:" sections John Snow
2025-06-26 19:53 ` [PATCH v5 4/4] qapi: rephrase return docs to avoid type name 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=877c0xl63z.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=anisinha@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=farosas@suse.de \
--cc=hreitz@redhat.com \
--cc=jasowang@redhat.com \
--cc=jiri@resnulli.us \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=lukasstraub2@web.de \
--cc=mads@ynddal.dk \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mjt@tls.msk.ru \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=pizhenwei@bytedance.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
--cc=stefanha@redhat.com \
--cc=vsementsov@yandex-team.ru \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).