docs/interop/firmware.json: scripts/qapi-gen.py compatibility
v4 cover docs/interop/firmware.json: scripts/qapi-gen.py compatibility
docs/interop/firmware.json is currently not usable with qapi-gen.py due to various non-functional issues.
Fix those issue to provide compatibility.
In v3 there was an open question about @file vs. @raw, but given that the existing descriptors in pc-bios/descriptors/ are already using @raw it seems clear the we have to keep it.
---
Changes in v4:
- Update "since" to 9.1
- Add comment to 'member-name-exceptions'
- Document enum members and drop 'documentation-exceptions'
- Link to v3: https://lore.kernel.org/r/[email protected]
Changes in v3:
- Drop already picked up patches
- Drop include of pragma.json
- Introduce new enums FirmwareFormat and FirmwareArchitecture
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Add review tag from Philippe
- Add Fixes tag (Philippe)
- Add testcase (Philippe)
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Thomas Weißschuh (3):
docs/interop/firmware.json: add new enum FirmwareFormat docs/interop/firmware.json: add new enum FirmwareArchitecture
docs: add test for firmware.json QAPI
docs/interop/firmware.json | 46 ++++++++++++++++++++++++++++++++++++++++++---- docs/meson.build | 5 +++++ 2 files changed, 47 insertions(+), 4 deletions(-)
---
base-commit: 58ee924b97d1c0898555647a31820c5a20d55a73
change-id: 20240306-qapi-firmware-json-6fb1213936dd
Best regards,
Signature · 1 line
Thomas Weißschuh <[email protected]>
PATCH v4 1/3 docs/interop/firmware.json: add new enum FirmwareFormat
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.
--- docs/interop/firmware.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
docs/interop/firmware.json +15 -2
@@ -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' } } ##
Signature · 1 line
2.45.2
Re: [PATCH v4 1/3] docs/interop/firmware.json: add new enum FirmwareFormat
Quoted 11 lines · 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é <[email protected]>Signed-off-by Thomas Weißschuh <[email protected]>--- docs/interop/firmware.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: 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 :|
PATCH v4 2/3 docs/interop/firmware.json: add new enum FirmwareArchitecture
In reply to Thomas WeißschuhOnly 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.
--- docs/interop/firmware.json | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
docs/interop/firmware.json +27 -2
@@ -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' ] } } ##
Signature · 1 line
2.45.2
Re: [PATCH v4 2/3] docs/interop/firmware.json: add new enum FirmwareArchitecture
Quoted 11 lines · 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é <[email protected]>Signed-off-by Thomas Weißschuh <[email protected]>--- docs/interop/firmware.json | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
With regards,
Daniel
Signature · 3 lines
|: 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 :|
PATCH v4 3/3 docs: add test for firmware.json QAPI
In reply to Thomas WeißschuhTo make sure that the QAPI description stays valid add a testcase.
--- docs/meson.build | 5 +++++ 1 file changed, 5 insertions(+)
docs/meson.build +5 -0
@@ -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'])
Signature · 1 line
2.45.2
Re: [PATCH v4 3/3] docs: add test for firmware.json QAPI
Quoted 8 lines · Thomas Weißschuh
To make sure that the QAPI description stays valid add a testcase.
Suggested-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Thomas Weißschuh <[email protected]>--- docs/meson.build | 5 +++++ 1 file changed, 5 insertions(+)
With regards,
Daniel
Signature · 3 lines
|: 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 :|