Skip to contentSkip to conversation

docs/interop/firmware.json: scripts/qapi-gen.py compatibility

PATCH Superseded Thomas Weißschuh 5 participants 13 messages Mar 6, 2024 – Mar 8, 2024

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

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.

---
Thomas Weißschuh (4):
docs/interop/firmware.json: Align examples docs/interop/firmware.json: Fix doc for FirmwareFlashMode docs/interop/firmware.json: Use full include paths docs/interop/firmware.json: Include pragma.json

 docs/interop/firmware.json | 392 +++++++++++++++++++++++----------------------
 1 file changed, 197 insertions(+), 195 deletions(-)

---
base-commit: db596ae19040574e41d086e78469014191d7d7fc
change-id: 20240306-qapi-firmware-json-6fb1213936dd

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#1 lore raw

PATCH 1/4 docs/interop/firmware.json: Align examples

The QAPI generator now validates the alignment and rejects this file.

---
 docs/interop/firmware.json | 384 ++++++++++++++++++++++-----------------------
 1 file changed, 192 insertions(+), 192 deletions(-)
docs/interop/firmware.json +192 -192
index cc8f86918681..a024f1b9bf3f 100644
@@ -435,203 +435,203 @@
 #
 # Examples:
 #
-# {
-#     "description": "SeaBIOS",
-#     "interface-types": [
-#         "bios"
-#     ],
-#     "mapping": {
-#         "device": "memory",
-#         "filename": "/usr/share/seabios/bios-256k.bin"
-#     },
-#     "targets": [
-#         {
-#             "architecture": "i386",
-#             "machines": [
-#                 "pc-i440fx-*",
-#                 "pc-q35-*"
-#             ]
+#     {
+#         "description": "SeaBIOS",
+#         "interface-types": [
+#             "bios"
+#         ],
+#         "mapping": {
+#             "device": "memory",
+#             "filename": "/usr/share/seabios/bios-256k.bin"
 #         },
-#         {
-#             "architecture": "x86_64",
-#             "machines": [
-#                 "pc-i440fx-*",
-#                 "pc-q35-*"
-#             ]
-#         }
-#     ],
-#     "features": [
-#         "acpi-s3",
-#         "acpi-s4"
-#     ],
-#     "tags": [
-#         "CONFIG_BOOTSPLASH=n",
-#         "CONFIG_ROM_SIZE=256",
-#         "CONFIG_USE_SMM=n"
-#     ]
-# }
-#
-# {
-#     "description": "OVMF with SB+SMM, empty varstore",
-#     "interface-types": [
-#         "uefi"
-#     ],
-#     "mapping": {
-#         "device": "flash",
-#         "executable": {
-#             "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd",
-#             "format": "raw"
+#         "targets": [
+#             {
+#                 "architecture": "i386",
+#                 "machines": [
+#                     "pc-i440fx-*",
+#                     "pc-q35-*"
+#                 ]
+#             },
+#             {
+#                 "architecture": "x86_64",
+#                 "machines": [
+#                     "pc-i440fx-*",
+#                     "pc-q35-*"
+#                 ]
+#             }
+#         ],
+#         "features": [
+#             "acpi-s3",
+#             "acpi-s4"
+#         ],
+#         "tags": [
+#             "CONFIG_BOOTSPLASH=n",
+#             "CONFIG_ROM_SIZE=256",
+#             "CONFIG_USE_SMM=n"
+#         ]
+#     }
+#
+#     {
+#         "description": "OVMF with SB+SMM, empty varstore",
+#         "interface-types": [
+#             "uefi"
+#         ],
+#         "mapping": {
+#             "device": "flash",
+#             "executable": {
+#                 "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd",
+#                 "format": "raw"
+#             },
+#             "nvram-template": {
+#                 "filename": "/usr/share/OVMF/OVMF_VARS.fd",
+#                 "format": "raw"
+#             }
 #         },
-#         "nvram-template": {
-#             "filename": "/usr/share/OVMF/OVMF_VARS.fd",
-#             "format": "raw"
-#         }
-#     },
-#     "targets": [
-#         {
-#             "architecture": "x86_64",
-#             "machines": [
-#                 "pc-q35-*"
-#             ]
-#         }
-#     ],
-#     "features": [
-#         "acpi-s3",
-#         "amd-sev",
-#         "requires-smm",
-#         "secure-boot",
-#         "verbose-dynamic"
-#     ],
-#     "tags": [
-#         "-a IA32",
-#         "-a X64",
-#         "-p OvmfPkg/OvmfPkgIa32X64.dsc",
-#         "-t GCC48",
-#         "-b DEBUG",
-#         "-D SMM_REQUIRE",
-#         "-D SECURE_BOOT_ENABLE",
-#         "-D FD_SIZE_4MB"
-#     ]
-# }
-#
-# {
-#     "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled",
-#     "interface-types": [
-#         "uefi"
-#     ],
-#     "mapping": {
-#         "device": "flash",
-#         "executable": {
-#             "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd",
-#             "format": "raw"
+#         "targets": [
+#             {
+#                 "architecture": "x86_64",
+#                 "machines": [
+#                     "pc-q35-*"
+#                 ]
+#             }
+#         ],
+#         "features": [
+#             "acpi-s3",
+#             "amd-sev",
+#             "requires-smm",
+#             "secure-boot",
+#             "verbose-dynamic"
+#         ],
+#         "tags": [
+#             "-a IA32",
+#             "-a X64",
+#             "-p OvmfPkg/OvmfPkgIa32X64.dsc",
+#             "-t GCC48",
+#             "-b DEBUG",
+#             "-D SMM_REQUIRE",
+#             "-D SECURE_BOOT_ENABLE",
+#             "-D FD_SIZE_4MB"
+#         ]
+#     }
+#
+#     {
+#         "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled",
+#         "interface-types": [
+#             "uefi"
+#         ],
+#         "mapping": {
+#             "device": "flash",
+#             "executable": {
+#                 "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd",
+#                 "format": "raw"
+#             },
+#             "nvram-template": {
+#                 "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd",
+#                 "format": "raw"
+#             }
 #         },
-#         "nvram-template": {
-#             "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd",
-#             "format": "raw"
-#         }
-#     },
-#     "targets": [
-#         {
-#             "architecture": "x86_64",
-#             "machines": [
-#                 "pc-q35-*"
-#             ]
-#         }
-#     ],
-#     "features": [
-#         "acpi-s3",
-#         "amd-sev",
-#         "enrolled-keys",
-#         "requires-smm",
-#         "secure-boot",
-#         "verbose-dynamic"
-#     ],
-#     "tags": [
-#         "-a IA32",
-#         "-a X64",
-#         "-p OvmfPkg/OvmfPkgIa32X64.dsc",
-#         "-t GCC48",
-#         "-b DEBUG",
-#         "-D SMM_REQUIRE",
-#         "-D SECURE_BOOT_ENABLE",
-#         "-D FD_SIZE_4MB"
-#     ]
-# }
-#
-# {
-#     "description": "OVMF with SEV-ES support",
-#     "interface-types": [
-#         "uefi"
-#     ],
-#     "mapping": {
-#         "device": "flash",
-#         "executable": {
-#             "filename": "/usr/share/OVMF/OVMF_CODE.fd",
-#             "format": "raw"
+#         "targets": [
+#             {
+#                 "architecture": "x86_64",
+#                 "machines": [
+#                     "pc-q35-*"
+#                 ]
+#             }
+#         ],
+#         "features": [
+#             "acpi-s3",
+#             "amd-sev",
+#             "enrolled-keys",
+#             "requires-smm",
+#             "secure-boot",
+#             "verbose-dynamic"
+#         ],
+#         "tags": [
+#             "-a IA32",
+#             "-a X64",
+#             "-p OvmfPkg/OvmfPkgIa32X64.dsc",
+#             "-t GCC48",
+#             "-b DEBUG",
+#             "-D SMM_REQUIRE",
+#             "-D SECURE_BOOT_ENABLE",
+#             "-D FD_SIZE_4MB"
+#         ]
+#     }
+#
+#     {
+#         "description": "OVMF with SEV-ES support",
+#         "interface-types": [
+#             "uefi"
+#         ],
+#         "mapping": {
+#             "device": "flash",
+#             "executable": {
+#                 "filename": "/usr/share/OVMF/OVMF_CODE.fd",
+#                 "format": "raw"
+#             },
+#             "nvram-template": {
+#                 "filename": "/usr/share/OVMF/OVMF_VARS.fd",
+#                 "format": "raw"
+#             }
 #         },
-#         "nvram-template": {
-#             "filename": "/usr/share/OVMF/OVMF_VARS.fd",
-#             "format": "raw"
-#         }
-#     },
-#     "targets": [
-#         {
-#             "architecture": "x86_64",
-#             "machines": [
-#                 "pc-q35-*"
-#             ]
-#         }
-#     ],
-#     "features": [
-#         "acpi-s3",
-#         "amd-sev",
-#         "amd-sev-es",
-#         "verbose-dynamic"
-#     ],
-#     "tags": [
-#         "-a X64",
-#         "-p OvmfPkg/OvmfPkgX64.dsc",
-#         "-t GCC48",
-#         "-b DEBUG",
-#         "-D FD_SIZE_4MB"
-#     ]
-# }
-#
-# {
-#     "description": "UEFI firmware for ARM64 virtual machines",
-#     "interface-types": [
-#         "uefi"
-#     ],
-#     "mapping": {
-#         "device": "flash",
-#         "executable": {
-#             "filename": "/usr/share/AAVMF/AAVMF_CODE.fd",
-#             "format": "raw"
+#         "targets": [
+#             {
+#                 "architecture": "x86_64",
+#                 "machines": [
+#                     "pc-q35-*"
+#                 ]
+#             }
+#         ],
+#         "features": [
+#             "acpi-s3",
+#             "amd-sev",
+#             "amd-sev-es",
+#             "verbose-dynamic"
+#         ],
+#         "tags": [
+#             "-a X64",
+#             "-p OvmfPkg/OvmfPkgX64.dsc",
+#             "-t GCC48",
+#             "-b DEBUG",
+#             "-D FD_SIZE_4MB"
+#         ]
+#     }
+#
+#     {
+#         "description": "UEFI firmware for ARM64 virtual machines",
+#         "interface-types": [
+#             "uefi"
+#         ],
+#         "mapping": {
+#             "device": "flash",
+#             "executable": {
+#                 "filename": "/usr/share/AAVMF/AAVMF_CODE.fd",
+#                 "format": "raw"
+#             },
+#             "nvram-template": {
+#                 "filename": "/usr/share/AAVMF/AAVMF_VARS.fd",
+#                 "format": "raw"
+#             }
 #         },
-#         "nvram-template": {
-#             "filename": "/usr/share/AAVMF/AAVMF_VARS.fd",
-#             "format": "raw"
-#         }
-#     },
-#     "targets": [
-#         {
-#             "architecture": "aarch64",
-#             "machines": [
-#                 "virt-*"
-#             ]
-#         }
-#     ],
-#     "features": [
-#
-#     ],
-#     "tags": [
-#         "-a AARCH64",
-#         "-p ArmVirtPkg/ArmVirtQemu.dsc",
-#         "-t GCC48",
-#         "-b DEBUG",
-#         "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000"
-#     ]
-# }
+#         "targets": [
+#             {
+#                 "architecture": "aarch64",
+#                 "machines": [
+#                     "virt-*"
+#                 ]
+#             }
+#         ],
+#         "features": [
+#
+#         ],
+#         "tags": [
+#             "-a AARCH64",
+#             "-p ArmVirtPkg/ArmVirtQemu.dsc",
+#             "-t GCC48",
+#             "-b DEBUG",
+#             "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000"
+#         ]
+#     }
 ##
 { 'struct' : 'Firmware',
   'data'   : { 'description'     : 'str',
Signature · 1 line
2.44.0
#3 lore raw

PATCH 2/4 docs/interop/firmware.json: Fix doc for FirmwareFlashMode

In reply to Thomas Weißschuh

The doc title did not match the actual definition.

---
 docs/interop/firmware.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/interop/firmware.json +1 -1
index a024f1b9bf3f..54a1fc6c1041 100644
@@ -223,7 +223,7 @@
 
 
 ##
-# @FirmwareFlashType:
+# @FirmwareFlashMode:
 #
 # Describes how the firmware build handles code versus variable
 # persistence.
Signature · 1 line
2.44.0
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] docs/interop/firmware.json: Fix doc for FirmwareFlashMode

Quoted 2 lines · Thomas Weißschuh

The doc title did not match the actual definition.

Fixes 2720ceda05 ("docs: expand firmware descriptor to allow flash without NVRAM")
Quoted 19 lines
---
  docs/interop/firmware.json | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
docs/interop/firmware.json +1 -1
index a024f1b9bf3f..54a1fc6c1041 100644
@@ -223,7 +223,7 @@
 
 
  ##
-# @FirmwareFlashType:
+# @FirmwareFlashMode:
  #
  # Describes how the firmware build handles code versus variable
  # persistence.
#5 lore raw

PATCH 3/4 docs/interop/firmware.json: Use full include paths

In reply to Thomas Weißschuh

The included files are part of the toplevel QAPI directory and need to be included from there.

---
 docs/interop/firmware.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/interop/firmware.json +2 -2
index 54a1fc6c1041..4ac840e2b413 100644
@@ -14,8 +14,8 @@
 # = Firmware
 ##
 
-{ 'include' : 'machine.json' }
-{ 'include' : 'block-core.json' }
+{ 'include' : '../../qapi/machine.json' }
+{ 'include' : '../../qapi/block-core.json' }
 
 ##
 # @FirmwareOSInterface:
Signature · 1 line
2.44.0
#6 lore raw

Re: [PATCH 3/4] docs/interop/firmware.json: Use full include paths

Quoted 13 lines · Thomas Weißschuh

The included files are part of the toplevel QAPI directory and need to be included from there.

---
 docs/interop/firmware.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/interop/firmware.json +0 -0
index 54a1fc6c1041..4ac840e2b413 100644

docs/interop/firmware.json line 21

Quoted 10 lines
docs/interop/firmware.json +2 -2
@@ -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?

#7 lore raw

Re: [PATCH 3/4] docs/interop/firmware.json: Use full include paths

Quoted 32 lines · Markus Armbruster
Quoted 13 lines · Thomas Weißschuh

The included files are part of the toplevel QAPI directory and need to be included from there.

---
 docs/interop/firmware.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
docs/interop/firmware.json +0 -0
index 54a1fc6c1041..4ac840e2b413 100644

docs/interop/firmware.json line 21

Quoted 10 lines
docs/interop/firmware.json +2 -2
@@ -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.

Quoted 8 lines

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.

I am writing a tool "qemu-firmware" that can be used to query and introspect those installed JSON description files.
This is where my changes are coming from.

That tool is meant to be pushed to qemu upstream but it's not ready yet.

Quoted 7 lines

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.

The generated code also doesn't link properly because it has dependencies on various parts of qemu internals.

In my "qemu-firmware" branch I have two more commits that split SysEmuTarget and BlockdevDriver into their own JSON files. Then everything works nicely.
These commits were not submitted yet as they felt specific to my usecase.

Quoted 11 lines

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.

As mentioned above, this is what I ended up doing and which I prefer for my usecase.

Quoted 11 lines

* 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?

#8 lore raw

Re: [PATCH 3/4] docs/interop/firmware.json: Use full include paths

In reply to Markus Armbruster
Quoted 12 lines · Markus Armbruster

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.

Quoted 6 lines

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.

firmware.json can use BlockdevDriver, but we could question whether it /should/ use BlockdevDriver. Is there really a compelling reason to support every possible block driver for readonly firmware and tiny nvram file ? I thin kit would be totally reasonable to define a "FirmwareFormat" enum which
only permitted 'raw' and 'qcow2'. If someone wants to
justify why we need another format, I'm all ears...

For SysEmuTarget its a little more useful, as in theory the firmware could be extended to any QEMU target. In practice thus far we've only used it todescribe EFI based firmware, which is relevant for a subset of targets. It doesn't seem to be a huge downside to define a FirmwareTarget enum with only the arches we've actually got a use for so far. When someone comes along with a need for non-EFI we can extend it, and we'll need to extend libvirt at the same time anyway

Quoted 12 lines

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.

Quoted 7 lines

* 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.

IMHO copy the enum. While the risk exists, I don't think it is a risk worth worrying about in reality. If someone points out a gap that's important is a matter of minutes to patch it.

Quoted 5 lines

* Dumb down to 'str'.

Drawback: the conformance check no longer enforces the value of FirmwareTarget member @architecture and FirmwareFlashFile member @format is valid.

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 :|
#9 lore raw

Re: [PATCH 3/4] docs/interop/firmware.json: Use full include paths

Quoted 28 lines · Daniel P. Berrangé
Quoted 12 lines · Markus Armbruster

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.

Quoted 6 lines

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.

firmware.json can use BlockdevDriver, but we could question whether it /should/ use BlockdevDriver. Is there really a compelling reason to support every possible block driver for readonly firmware and tiny nvram file ? I thin kit would be totally reasonable to define a "FirmwareFormat" enum which
only permitted 'raw' and 'qcow2'. If someone wants to
justify why we need another format, I'm all ears...

Quoted 16 lines

For SysEmuTarget its a little more useful, as in theory the firmware could be extended to any QEMU target. In practice thus far we've only used it todescribe EFI based firmware, which is relevant for a subset of targets. It doesn't seem to be a huge downside to define a FirmwareTarget enum with only the arches we've actually got a use for so far. When someone comes along with a need for non-EFI we can extend it, and we'll need to extend libvirt at the same time anyway

Quoted 7 lines

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.

=)

Quoted 9 lines
Quoted 9 lines

Options:

* Live with the mess.

* Refactor QAPI modules so firmware.json can include just the enums.

Drawback: we spread the mess into qapi/. Ugh.

Quoted 7 lines
Quoted 3 lines

* Copy the enums to firmware.json.

Drawback: we risk them going stale.

IMHO copy the enum. While the risk exists, I don't think it is a risk worth worrying about in reality. If someone points out a gap that's important is a matter of minutes to patch it.

Since I concur with Daniel PoV, I'm queuing patches 1 (with Markus reword) and 2 so far, so less to carry for v3.

Regards,

Phil.

#10 lore raw

PATCH 4/4 docs/interop/firmware.json: Include pragma.json

In reply to Thomas Weißschuh

The files included by firmware.json use names that do not satisfy the generators requirements.
By including pragma.json these errors are suppressed.

---
 docs/interop/firmware.json | 2 ++
 1 file changed, 2 insertions(+)
docs/interop/firmware.json +2 -0
index 4ac840e2b413..a7e9a22a0046 100644
@@ -10,6 +10,8 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later. See the COPYING file in the top-level directory.
 
+{ 'include' : '../../qapi/pragma.json' }
+
 ##
 # = Firmware
 ##
Signature · 1 line
2.44.0
#11 lore raw
In reply to Thomas Weißschuh
Quoted 3 lines · Thomas Weißschuh

docs/interop/firmware.json is currently not usable with qapi-gen.py due to various non-functional issues.
Fix those issue to provide compatibility.

Could we add some lines in docs/meson.build to cover this files during our CI tests?

Quoted 16 lines

---
Thomas Weißschuh (4):
docs/interop/firmware.json: Align examples docs/interop/firmware.json: Fix doc for FirmwareFlashMode docs/interop/firmware.json: Use full include paths docs/interop/firmware.json: Include pragma.json

  docs/interop/firmware.json | 392 +++++++++++++++++++++++----------------------
  1 file changed, 197 insertions(+), 195 deletions(-)

---
base-commit: db596ae19040574e41d086e78469014191d7d7fc
change-id: 20240306-qapi-firmware-json-6fb1213936dd

Best regards,

#12 lore raw
Quoted 7 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Thomas Weißschuh

docs/interop/firmware.json is currently not usable with qapi-gen.py due to various non-functional issues.
Fix those issue to provide compatibility.

Could we add some lines in docs/meson.build to cover this files during our CI tests?

Sounds good.

I am also developing a new tool which would use the generated QAPI files which I plan to submit soonish.

Quoted 16 lines
Quoted 16 lines

---
Thomas Weißschuh (4):
docs/interop/firmware.json: Align examples docs/interop/firmware.json: Fix doc for FirmwareFlashMode docs/interop/firmware.json: Use full include paths docs/interop/firmware.json: Include pragma.json

  docs/interop/firmware.json | 392 +++++++++++++++++++++++----------------------
  1 file changed, 197 insertions(+), 195 deletions(-)

---
base-commit: db596ae19040574e41d086e78469014191d7d7fc
change-id: 20240306-qapi-firmware-json-6fb1213936dd

Best regards,