* [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat
2024-07-18 12:21 [PATCH v5 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh
@ 2024-07-18 12:21 ` Thomas Weißschuh
2024-07-18 13:09 ` Markus Armbruster
2024-07-18 12:21 ` [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture Thomas Weißschuh
` (2 subsequent siblings)
3 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 12:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy
Cc: qemu-devel, Kevin Wolf, Hanna Czenczek, Thomas Weißschuh
Only a small subset of all blockdev drivers make sense for firmware
images. Introduce and use a new enum to represent this.
This also reduces the dependency on firmware.json from the global qapi
definitions.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
docs/interop/firmware.json | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 54a1fc6c1041..a26fe81bf2fe 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -15,7 +15,6 @@
##
{ 'include' : 'machine.json' }
-{ 'include' : 'block-core.json' }
##
# @FirmwareOSInterface:
@@ -200,6 +199,20 @@
'enrolled-keys', 'requires-smm', 'secure-boot',
'verbose-dynamic', 'verbose-static' ] }
+##
+# @FirmwareFormat:
+#
+# Formats that are supported for firmware images.
+#
+# @raw: Raw disk image format.
+#
+# @qcow2: QEMU image format.
+#
+# Since: 9.1
+##
+{ 'enum': 'FirmwareFormat',
+ 'data': [ 'raw', 'qcow2' ] }
+
##
# @FirmwareFlashFile:
#
@@ -219,7 +232,7 @@
##
{ 'struct' : 'FirmwareFlashFile',
'data' : { 'filename' : 'str',
- 'format' : 'BlockdevDriver' } }
+ 'format' : 'FirmwareFormat' } }
##
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat
2024-07-18 12:21 ` [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat Thomas Weißschuh
@ 2024-07-18 13:09 ` Markus Armbruster
2024-07-18 13:25 ` Thomas Weißschuh
2024-07-18 14:02 ` Kashyap Chamarthy
0 siblings, 2 replies; 14+ messages in thread
From: Markus Armbruster @ 2024-07-18 13:09 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
> Only a small subset of all blockdev drivers make sense for firmware
> images. Introduce and use a new enum to represent this.
>
> This also reduces the dependency on firmware.json from the global qapi
> definitions.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> docs/interop/firmware.json | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> index 54a1fc6c1041..a26fe81bf2fe 100644
> --- a/docs/interop/firmware.json
> +++ b/docs/interop/firmware.json
> @@ -15,7 +15,6 @@
> ##
>
> { 'include' : 'machine.json' }
> -{ 'include' : 'block-core.json' }
>
> ##
> # @FirmwareOSInterface:
> @@ -200,6 +199,20 @@
> 'enrolled-keys', 'requires-smm', 'secure-boot',
> 'verbose-dynamic', 'verbose-static' ] }
>
> +##
> +# @FirmwareFormat:
> +#
> +# Formats that are supported for firmware images.
> +#
> +# @raw: Raw disk image format.
> +#
> +# @qcow2: QEMU image format.
It's not the only QEMU image format... Maybe "The QCOW2 image format."
Almost tautological, but I don't have better ideas.
> +#
> +# Since: 9.1
The enum type is indeed since 9.1, but its two members are since 3.0,
and that's what matters.
> +##
> +{ 'enum': 'FirmwareFormat',
> + 'data': [ 'raw', 'qcow2' ] }
> +
> ##
> # @FirmwareFlashFile:
> #
> @@ -219,7 +232,7 @@
> ##
> { 'struct' : 'FirmwareFlashFile',
> 'data' : { 'filename' : 'str',
> - 'format' : 'BlockdevDriver' } }
> + 'format' : 'FirmwareFormat' } }
>
>
> ##
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat
2024-07-18 13:09 ` Markus Armbruster
@ 2024-07-18 13:25 ` Thomas Weißschuh
2024-07-18 13:46 ` Markus Armbruster
2024-07-18 14:02 ` Kashyap Chamarthy
1 sibling, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 13:25 UTC (permalink / raw)
To: Markus Armbruster
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
On Thu, Jul 18, 2024 at 03:09:37PM GMT, Markus Armbruster wrote:
> Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
>
> > Only a small subset of all blockdev drivers make sense for firmware
> > images. Introduce and use a new enum to represent this.
> >
> > This also reduces the dependency on firmware.json from the global qapi
> > definitions.
> >
> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > ---
> > docs/interop/firmware.json | 17 +++++++++++++++--
> > 1 file changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> > index 54a1fc6c1041..a26fe81bf2fe 100644
> > --- a/docs/interop/firmware.json
> > +++ b/docs/interop/firmware.json
> > @@ -15,7 +15,6 @@
> > ##
> >
> > { 'include' : 'machine.json' }
> > -{ 'include' : 'block-core.json' }
> >
> > ##
> > # @FirmwareOSInterface:
> > @@ -200,6 +199,20 @@
> > 'enrolled-keys', 'requires-smm', 'secure-boot',
> > 'verbose-dynamic', 'verbose-static' ] }
> >
> > +##
> > +# @FirmwareFormat:
> > +#
> > +# Formats that are supported for firmware images.
> > +#
> > +# @raw: Raw disk image format.
> > +#
> > +# @qcow2: QEMU image format.
>
> It's not the only QEMU image format... Maybe "The QCOW2 image format."
> Almost tautological, but I don't have better ideas.
I used the wording from qemu-img(1).
If you prefer "The QCOW2 image format", I'll switch to that.
> > +#
> > +# Since: 9.1
>
> The enum type is indeed since 9.1, but its two members are since 3.0,
> and that's what matters.
Ack.
So I change the Since: of the whole enum?
And not on the individual members?
> > +##
> > +{ 'enum': 'FirmwareFormat',
> > + 'data': [ 'raw', 'qcow2' ] }
> > +
> > ##
> > # @FirmwareFlashFile:
> > #
> > @@ -219,7 +232,7 @@
> > ##
> > { 'struct' : 'FirmwareFlashFile',
> > 'data' : { 'filename' : 'str',
> > - 'format' : 'BlockdevDriver' } }
> > + 'format' : 'FirmwareFormat' } }
> >
> >
> > ##
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat
2024-07-18 13:25 ` Thomas Weißschuh
@ 2024-07-18 13:46 ` Markus Armbruster
0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2024-07-18 13:46 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
Thomas Weißschuh <t-8ch@linutronix.de> writes:
> On Thu, Jul 18, 2024 at 03:09:37PM GMT, Markus Armbruster wrote:
>> Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
>>
>> > Only a small subset of all blockdev drivers make sense for firmware
>> > images. Introduce and use a new enum to represent this.
>> >
>> > This also reduces the dependency on firmware.json from the global qapi
>> > definitions.
>> >
>> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
>> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>> > ---
>> > docs/interop/firmware.json | 17 +++++++++++++++--
>> > 1 file changed, 15 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
>> > index 54a1fc6c1041..a26fe81bf2fe 100644
>> > --- a/docs/interop/firmware.json
>> > +++ b/docs/interop/firmware.json
>> > @@ -15,7 +15,6 @@
>> > ##
>> >
>> > { 'include' : 'machine.json' }
>> > -{ 'include' : 'block-core.json' }
>> >
>> > ##
>> > # @FirmwareOSInterface:
>> > @@ -200,6 +199,20 @@
>> > 'enrolled-keys', 'requires-smm', 'secure-boot',
>> > 'verbose-dynamic', 'verbose-static' ] }
>> >
>> > +##
>> > +# @FirmwareFormat:
>> > +#
>> > +# Formats that are supported for firmware images.
>> > +#
>> > +# @raw: Raw disk image format.
>> > +#
>> > +# @qcow2: QEMU image format.
>>
>> It's not the only QEMU image format... Maybe "The QCOW2 image format."
>> Almost tautological, but I don't have better ideas.
>
> I used the wording from qemu-img(1).
Interesting, wasn't aware.
> If you prefer "The QCOW2 image format", I'll switch to that.
Up to you, unless Kevin or Hanna have a preference.
>> > +#
>> > +# Since: 9.1
>>
>> The enum type is indeed since 9.1, but its two members are since 3.0,
>> and that's what matters.
>
> Ack.
>
> So I change the Since: of the whole enum?
> And not on the individual members?
Whole enum is simpler, so that's what I'd do. Perhaps with a brief
explanation in the commit message. Here's my try:
Claim "Since: 3.0" for the new enum, because that's correct for its
members, and the members are what matters in the interface.
>> > +##
>> > +{ 'enum': 'FirmwareFormat',
>> > + 'data': [ 'raw', 'qcow2' ] }
>> > +
>> > ##
>> > # @FirmwareFlashFile:
>> > #
>> > @@ -219,7 +232,7 @@
>> > ##
>> > { 'struct' : 'FirmwareFlashFile',
>> > 'data' : { 'filename' : 'str',
>> > - 'format' : 'BlockdevDriver' } }
>> > + 'format' : 'FirmwareFormat' } }
>> >
>> >
>> > ##
>>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat
2024-07-18 13:09 ` Markus Armbruster
2024-07-18 13:25 ` Thomas Weißschuh
@ 2024-07-18 14:02 ` Kashyap Chamarthy
1 sibling, 0 replies; 14+ messages in thread
From: Kashyap Chamarthy @ 2024-07-18 14:02 UTC (permalink / raw)
To: Markus Armbruster
Cc: Thomas Weißschuh, Philippe Mathieu-Daudé,
Daniel P. Berrangé, qemu-devel, Kevin Wolf, Hanna Czenczek
On Thu, Jul 18, 2024 at 03:09:37PM +0200, Markus Armbruster wrote:
> Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
[...]
> > +#
> > +# @raw: Raw disk image format.
> > +#
> > +# @qcow2: QEMU image format.
>
> It's not the only QEMU image format... Maybe "The QCOW2 image format."
> Almost tautological, but I don't have better ideas.
For slightly less tautology, not sure these are any better:
@raw: Disk image format that's plain and unstructured.
@qcow2: Disk image format with support for copy-on-write and more.
[...]
--
/kashyap
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture
2024-07-18 12:21 [PATCH v5 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh
2024-07-18 12:21 ` [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat Thomas Weißschuh
@ 2024-07-18 12:21 ` Thomas Weißschuh
2024-07-18 13:18 ` Markus Armbruster
2024-07-18 12:21 ` [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section Thomas Weißschuh
2024-07-18 12:21 ` [PATCH v5 4/4] docs: add test for firmware.json QAPI Thomas Weißschuh
3 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 12:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy
Cc: qemu-devel, Kevin Wolf, Hanna Czenczek, Thomas Weißschuh
Only a small subset of all architectures supported by qemu make use of
firmware files. Introduce and use a new enum to represent this.
This also removes the dependency to machine.json from the global qapi
definitions.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
docs/interop/firmware.json | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index a26fe81bf2fe..2eb0be11d595 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -14,7 +14,10 @@
# = Firmware
##
-{ 'include' : 'machine.json' }
+{ 'pragma': {
+ 'member-name-exceptions': [
+ 'FirmwareArchitecture' # x86_64
+ ] } }
##
# @FirmwareOSInterface:
@@ -59,6 +62,28 @@
{ 'enum' : 'FirmwareDevice',
'data' : [ 'flash', 'kernel', 'memory' ] }
+##
+# @FirmwareArchitecture:
+#
+# Enumerations of architectures for which Qemu uses additional firmware files.
+# The values are a subset of the enum SysEmuTarget.
+#
+# @aarch64: 64-bit Arm.
+#
+# @arm: 32-bit Arm.
+#
+# @i386: 32-bit x86.
+#
+# @loongarch64: 64-bit LoongArch.
+#
+# @x86_64: 64-bit x86.
+#
+# Since: 9.1
+##
+{ 'enum' : 'FirmwareArchitecture',
+ 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] }
+
+
##
# @FirmwareTarget:
#
@@ -80,7 +105,7 @@
# Since: 3.0
##
{ 'struct' : 'FirmwareTarget',
- 'data' : { 'architecture' : 'SysEmuTarget',
+ 'data' : { 'architecture' : 'FirmwareArchitecture',
'machines' : [ 'str' ] } }
##
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture
2024-07-18 12:21 ` [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture Thomas Weißschuh
@ 2024-07-18 13:18 ` Markus Armbruster
2024-07-18 13:29 ` Thomas Weißschuh
0 siblings, 1 reply; 14+ messages in thread
From: Markus Armbruster @ 2024-07-18 13:18 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
> Only a small subset of all architectures supported by qemu make use of
> firmware files. Introduce and use a new enum to represent this.
>
> This also removes the dependency to machine.json from the global qapi
> definitions.
>
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> docs/interop/firmware.json | 29 +++++++++++++++++++++++++++--
> 1 file changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> index a26fe81bf2fe..2eb0be11d595 100644
> --- a/docs/interop/firmware.json
> +++ b/docs/interop/firmware.json
> @@ -14,7 +14,10 @@
> # = Firmware
> ##
>
> -{ 'include' : 'machine.json' }
> +{ 'pragma': {
> + 'member-name-exceptions': [
> + 'FirmwareArchitecture' # x86_64
> + ] } }
>
> ##
> # @FirmwareOSInterface:
> @@ -59,6 +62,28 @@
> { 'enum' : 'FirmwareDevice',
> 'data' : [ 'flash', 'kernel', 'memory' ] }
>
> +##
> +# @FirmwareArchitecture:
> +#
> +# Enumerations of architectures for which Qemu uses additional firmware files.
docs/devel/qapi-code-gen.rst section "Documentation markup":
For legibility, wrap text paragraphs so every line is at most 70
characters long.
> +# The values are a subset of the enum SysEmuTarget.
Will consumers of firmware.json care for this? Or is it just a reminder
for developers to keep the two enums in sync?
> +#
> +# @aarch64: 64-bit Arm.
> +#
> +# @arm: 32-bit Arm.
> +#
> +# @i386: 32-bit x86.
> +#
> +# @loongarch64: 64-bit LoongArch.
> +#
> +# @x86_64: 64-bit x86.
> +#
> +# Since: 9.1
The enum type is indeed since 9.1, but its members are since 3.0, and
that's what matters. Except for @loongarch, which is since 7.1.0 (not
documented in qapi/machine.json; I'll fix that).
> +##
> +{ 'enum' : 'FirmwareArchitecture',
> + 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] }
> +
> +
Drop one blank line, please.
> ##
> # @FirmwareTarget:
> #
> @@ -80,7 +105,7 @@
> # Since: 3.0
> ##
> { 'struct' : 'FirmwareTarget',
> - 'data' : { 'architecture' : 'SysEmuTarget',
> + 'data' : { 'architecture' : 'FirmwareArchitecture',
> 'machines' : [ 'str' ] } }
>
> ##
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture
2024-07-18 13:18 ` Markus Armbruster
@ 2024-07-18 13:29 ` Thomas Weißschuh
2024-07-18 13:48 ` Markus Armbruster
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 13:29 UTC (permalink / raw)
To: Markus Armbruster
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
On Thu, Jul 18, 2024 at 03:18:07PM GMT, Markus Armbruster wrote:
> Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
>
> > Only a small subset of all architectures supported by qemu make use of
> > firmware files. Introduce and use a new enum to represent this.
> >
> > This also removes the dependency to machine.json from the global qapi
> > definitions.
> >
> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> > ---
> > docs/interop/firmware.json | 29 +++++++++++++++++++++++++++--
> > 1 file changed, 27 insertions(+), 2 deletions(-)
> >
> > diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> > index a26fe81bf2fe..2eb0be11d595 100644
> > --- a/docs/interop/firmware.json
> > +++ b/docs/interop/firmware.json
> > @@ -14,7 +14,10 @@
> > # = Firmware
> > ##
> >
> > -{ 'include' : 'machine.json' }
> > +{ 'pragma': {
> > + 'member-name-exceptions': [
> > + 'FirmwareArchitecture' # x86_64
> > + ] } }
> >
> > ##
> > # @FirmwareOSInterface:
> > @@ -59,6 +62,28 @@
> > { 'enum' : 'FirmwareDevice',
> > 'data' : [ 'flash', 'kernel', 'memory' ] }
> >
> > +##
> > +# @FirmwareArchitecture:
> > +#
> > +# Enumerations of architectures for which Qemu uses additional firmware files.
>
> docs/devel/qapi-code-gen.rst section "Documentation markup":
>
> For legibility, wrap text paragraphs so every line is at most 70
> characters long.
>
> > +# The values are a subset of the enum SysEmuTarget.
Ack.
> Will consumers of firmware.json care for this?
Most probably not.
> Or is it just a reminder for developers to keep the two enums in sync?
I guess so.
Should I drop it?
>
> > +#
> > +# @aarch64: 64-bit Arm.
> > +#
> > +# @arm: 32-bit Arm.
> > +#
> > +# @i386: 32-bit x86.
> > +#
> > +# @loongarch64: 64-bit LoongArch.
> > +#
> > +# @x86_64: 64-bit x86.
> > +#
> > +# Since: 9.1
>
> The enum type is indeed since 9.1, but its members are since 3.0, and
> that's what matters. Except for @loongarch, which is since 7.1.0 (not
> documented in qapi/machine.json; I'll fix that).
>
> > +##
> > +{ 'enum' : 'FirmwareArchitecture',
> > + 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] }
> > +
> > +
>
> Drop one blank line, please.
Ack.
>
> > ##
> > # @FirmwareTarget:
> > #
> > @@ -80,7 +105,7 @@
> > # Since: 3.0
> > ##
> > { 'struct' : 'FirmwareTarget',
> > - 'data' : { 'architecture' : 'SysEmuTarget',
> > + 'data' : { 'architecture' : 'FirmwareArchitecture',
> > 'machines' : [ 'str' ] } }
> >
> > ##
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture
2024-07-18 13:29 ` Thomas Weißschuh
@ 2024-07-18 13:48 ` Markus Armbruster
0 siblings, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2024-07-18 13:48 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Markus Armbruster, Philippe Mathieu-Daudé,
Daniel P. Berrangé, Kashyap Chamarthy, qemu-devel,
Kevin Wolf, Hanna Czenczek
Thomas Weißschuh <t-8ch@linutronix.de> writes:
> On Thu, Jul 18, 2024 at 03:18:07PM GMT, Markus Armbruster wrote:
>> Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
>>
>> > Only a small subset of all architectures supported by qemu make use of
>> > firmware files. Introduce and use a new enum to represent this.
>> >
>> > This also removes the dependency to machine.json from the global qapi
>> > definitions.
>> >
>> > Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
>> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
>> > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>> > ---
>> > docs/interop/firmware.json | 29 +++++++++++++++++++++++++++--
>> > 1 file changed, 27 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
>> > index a26fe81bf2fe..2eb0be11d595 100644
>> > --- a/docs/interop/firmware.json
>> > +++ b/docs/interop/firmware.json
>> > @@ -14,7 +14,10 @@
>> > # = Firmware
>> > ##
>> >
>> > -{ 'include' : 'machine.json' }
>> > +{ 'pragma': {
>> > + 'member-name-exceptions': [
>> > + 'FirmwareArchitecture' # x86_64
>> > + ] } }
>> >
>> > ##
>> > # @FirmwareOSInterface:
>> > @@ -59,6 +62,28 @@
>> > { 'enum' : 'FirmwareDevice',
>> > 'data' : [ 'flash', 'kernel', 'memory' ] }
>> >
>> > +##
>> > +# @FirmwareArchitecture:
>> > +#
>> > +# Enumerations of architectures for which Qemu uses additional firmware files.
>>
>> docs/devel/qapi-code-gen.rst section "Documentation markup":
>>
>> For legibility, wrap text paragraphs so every line is at most 70
>> characters long.
>>
>> > +# The values are a subset of the enum SysEmuTarget.
>
> Ack.
>
>> Will consumers of firmware.json care for this?
>
> Most probably not.
>
>> Or is it just a reminder for developers to keep the two enums in sync?
>
> I guess so.
> Should I drop it?
You can drop it.
If you think it's useful for developers, you can instead make it a
non-doc comment, like ...
>>
>> > +#
>> > +# @aarch64: 64-bit Arm.
>> > +#
>> > +# @arm: 32-bit Arm.
>> > +#
>> > +# @i386: 32-bit x86.
>> > +#
>> > +# @loongarch64: 64-bit LoongArch.
>> > +#
>> > +# @x86_64: 64-bit x86.
>> > +#
>> > +# Since: 9.1
>>
>> The enum type is indeed since 9.1, but its members are since 3.0, and
>> that's what matters. Except for @loongarch, which is since 7.1.0 (not
>> documented in qapi/machine.json; I'll fix that).
>>
>> > +##
>> > +{ 'enum' : 'FirmwareArchitecture',
>> > + 'data' : [ 'aarch64', 'arm', 'i386', 'loongarch64', 'x86_64' ] }
... here:
# The values are a subset of the enum SysEmuTarget defined in
# qapi/machine.json.
If you do, consider adding a similar note to FirmwareFormat in the
previous patch.
>> > +
>> > +
>>
>> Drop one blank line, please.
>
> Ack.
>
>>
>> > ##
>> > # @FirmwareTarget:
>> > #
>> > @@ -80,7 +105,7 @@
>> > # Since: 3.0
>> > ##
>> > { 'struct' : 'FirmwareTarget',
>> > - 'data' : { 'architecture' : 'SysEmuTarget',
>> > + 'data' : { 'architecture' : 'FirmwareArchitecture',
>> > 'machines' : [ 'str' ] } }
>> >
>> > ##
>>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section
2024-07-18 12:21 [PATCH v5 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh
2024-07-18 12:21 ` [PATCH v5 1/4] docs/interop/firmware.json: add new enum FirmwareFormat Thomas Weißschuh
2024-07-18 12:21 ` [PATCH v5 2/4] docs/interop/firmware.json: add new enum FirmwareArchitecture Thomas Weißschuh
@ 2024-07-18 12:21 ` Thomas Weißschuh
2024-07-18 12:30 ` Daniel P. Berrangé
2024-07-18 13:19 ` Markus Armbruster
2024-07-18 12:21 ` [PATCH v5 4/4] docs: add test for firmware.json QAPI Thomas Weißschuh
3 siblings, 2 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 12:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy
Cc: qemu-devel, Kevin Wolf, Hanna Czenczek, Thomas Weißschuh
Since commit 3c5f6114d9ff ("qapi: remove "Example" doc section")
the "Example" section is not valid anymore.
It has been replaced by the "qmp-example" role.
This was not detected earlier as firmware.json was not validated.
As this validation is about to be added, adapt firmware.json.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
docs/interop/firmware.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
index 2eb0be11d595..eea82eef3a07 100644
--- a/docs/interop/firmware.json
+++ b/docs/interop/firmware.json
@@ -471,7 +471,7 @@
#
# Since: 3.0
#
-# Examples:
+# .. qmp-example::
#
# {
# "description": "SeaBIOS",
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section
2024-07-18 12:21 ` [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section Thomas Weißschuh
@ 2024-07-18 12:30 ` Daniel P. Berrangé
2024-07-18 13:19 ` Markus Armbruster
1 sibling, 0 replies; 14+ messages in thread
From: Daniel P. Berrangé @ 2024-07-18 12:30 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Philippe Mathieu-Daudé, Kashyap Chamarthy, qemu-devel,
Kevin Wolf, Hanna Czenczek
On Thu, Jul 18, 2024 at 02:21:47PM +0200, Thomas Weißschuh wrote:
> Since commit 3c5f6114d9ff ("qapi: remove "Example" doc section")
> the "Example" section is not valid anymore.
> It has been replaced by the "qmp-example" role.
>
> This was not detected earlier as firmware.json was not validated.
> As this validation is about to be added, adapt firmware.json.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> docs/interop/firmware.json | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section
2024-07-18 12:21 ` [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section Thomas Weißschuh
2024-07-18 12:30 ` Daniel P. Berrangé
@ 2024-07-18 13:19 ` Markus Armbruster
1 sibling, 0 replies; 14+ messages in thread
From: Markus Armbruster @ 2024-07-18 13:19 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy, qemu-devel, Kevin Wolf, Hanna Czenczek
Thomas Weißschuh <thomas.weissschuh@linutronix.de> writes:
> Since commit 3c5f6114d9ff ("qapi: remove "Example" doc section")
> the "Example" section is not valid anymore.
> It has been replaced by the "qmp-example" role.
Make that "directive" instead of role.
> This was not detected earlier as firmware.json was not validated.
Sorry about that!
> As this validation is about to be added, adapt firmware.json.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> docs/interop/firmware.json | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json
> index 2eb0be11d595..eea82eef3a07 100644
> --- a/docs/interop/firmware.json
> +++ b/docs/interop/firmware.json
> @@ -471,7 +471,7 @@
> #
> # Since: 3.0
> #
> -# Examples:
> +# .. qmp-example::
> #
> # {
> # "description": "SeaBIOS",
Reviewed-by: Markus Armbruster <armbru@redhat.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v5 4/4] docs: add test for firmware.json QAPI
2024-07-18 12:21 [PATCH v5 0/4] docs/interop/firmware.json: scripts/qapi-gen.py compatibility Thomas Weißschuh
` (2 preceding siblings ...)
2024-07-18 12:21 ` [PATCH v5 3/4] docs/interop/firmware.json: convert "Example" section Thomas Weißschuh
@ 2024-07-18 12:21 ` Thomas Weißschuh
3 siblings, 0 replies; 14+ messages in thread
From: Thomas Weißschuh @ 2024-07-18 12:21 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Daniel P. Berrangé,
Kashyap Chamarthy
Cc: qemu-devel, Kevin Wolf, Hanna Czenczek, Thomas Weißschuh
To make sure that the QAPI description stays valid add a testcase.
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/d9ce0234-4beb-4b90-b14c-76810d3b81d7@linaro.org/
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
docs/meson.build | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/docs/meson.build b/docs/meson.build
index 9040f860ae1a..bcca45a342a3 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -99,3 +99,8 @@ if build_docs
alias_target('html', sphinxdocs)
alias_target('man', sphinxmans)
endif
+
+test('QAPI firmware.json regression tests', python,
+ args: [qapi_gen.full_path(), '-o', meson.current_build_dir() / 'qapi',
+ meson.current_source_dir() / 'interop/firmware.json'],
+ env: test_env, suite: ['qapi-schema', 'qapi-interop'])
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread