From: Markus Armbruster <armbru@redhat.com>
To: "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Kashyap Chamarthy" <kchamart@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 3/4] docs/interop/firmware.json: Use full include paths
Date: Fri, 08 Mar 2024 16:19:42 +0100 [thread overview]
Message-ID: <87le6s21kh.fsf@pond.sub.org> (raw)
In-Reply-To: <20240306-qapi-firmware-json-v1-3-619f7122a249@linutronix.de> ("Thomas Weißschuh"'s message of "Wed, 06 Mar 2024 11:31:24 +0100")
Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
> The included files are part of the toplevel QAPI directory and need to
> be included from there.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> docs/interop/firmware.json | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> index 54a1fc6c1041..4ac840e2b413 100644
> --- a/docs/interop/firmware.json
> +++ b/docs/interop/firmware.json
> @@ -14,8 +14,8 @@
> # = Firmware
> ##
>
> -{ 'include' : 'machine.json' }
> -{ 'include' : 'block-core.json' }
> +{ 'include' : '../../qapi/machine.json' }
> +{ 'include' : '../../qapi/block-core.json' }
>
> ##
> # @FirmwareOSInterface:
The coupling with the main QAPI schema is unfortunate.
The purpose of docs/interop/firmware.json is to serve as schema for
firmware descriptions: a firmware description is a JSON object that
conforms to this schema's struct Firmware.
Such a description should be installed along with each firmware binary.
QAPI tooling can be used to check conformance: parse the firmware
description JSON object, feed it to the generated visit_type_Firmware().
Success implies conformance.
If you find more uses for the C struct Firmware created by
visit_type_Firmware(), more power to you.
firmware.json needs machine.json for SysEmuTarget, and block-core.json
for BlockdevDriver. The largest and the third-largest QAPI module just
for two enums. Almost a quarter Mebibyte of code.
qapi-gen.py generates more than 12kSLOC. Without the include (and with
the enums dumbed down to 'str' to enable that), it generates less than
800.
We could use Sphinx to generate a manual from firmware.json's document.
Except that manual would be useless, because of its 11,000 lines of
HTML, less than 800 are for firmware.json.
Options:
* Live with the mess.
* Refactor QAPI modules so firmware.json can include just the enums.
Drawback: we spread the mess into qapi/. Ugh.
* Copy the enums to firmware.json.
Drawback: we risk them going stale.
* Dumb down to 'str'.
Drawback: the conformance check no longer enforces the value of
FirmwareTarget member @architecture and FirmwareFlashFile member
@format is valid.
Thoughts?
next prev parent reply other threads:[~2024-03-08 15:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 10:31 [PATCH 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh
2024-03-06 10:31 ` [PATCH 1/4] docs/interop/firmware.json: Align examples Thomas Weißschuh
2024-03-08 14:42 ` Markus Armbruster
2024-03-06 10:31 ` [PATCH 2/4] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Thomas Weißschuh
2024-03-06 16:13 ` Philippe Mathieu-Daudé
2024-03-06 10:31 ` [PATCH 3/4] docs/interop/firmware.json: Use full include paths Thomas Weißschuh
2024-03-08 15:19 ` Markus Armbruster [this message]
2024-03-08 15:54 ` Thomas Weißschuh
2024-03-08 16:09 ` Daniel P. Berrangé
2024-03-08 16:28 ` Philippe Mathieu-Daudé
2024-03-06 10:31 ` [PATCH 4/4] docs/interop/firmware.json: Include pragma.json Thomas Weißschuh
2024-03-06 16:15 ` [PATCH 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Philippe Mathieu-Daudé
2024-03-06 16:35 ` Thomas Weißschuh
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=87le6s21kh.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kchamart@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thomas.weissschuh@linutronix.de \
/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.