qemu-e2k/docs
Markus Armbruster de3b3f529d qapi: Require boxed for conditional command and event arguments
The C code generator fails to honor 'if' conditions of command and
event arguments.

For instance, tests/qapi-schema/qapi-schema-test.json has

    { 'event': 'TEST_IF_EVENT',
      'data': { 'foo': 'TestIfStruct',
		'bar': { 'type': ['str'], 'if': 'TEST_IF_EVT_ARG' } },
      'if': { 'all': ['TEST_IF_EVT', 'TEST_IF_STRUCT'] } }

Generated tests/test-qapi-events.h fails to honor the TEST_IF_EVT_ARG
condition:

    #if defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)
    void qapi_event_send_test_if_event(TestIfStruct *foo, strList *bar);
    #endif /* defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT) */

Only uses so far are in tests/.

We could fix the generator to emit something like

    #if defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)
    void qapi_event_send_test_if_event(TestIfStruct *foo
    #if defined(TEST_IF_EVT_ARG)
                    , strList *bar
    #endif
                    );
    #endif /* defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT) */

Ugly.  Calls become similarly ugly.  Not worth fixing.

Conditional arguments work fine with 'boxed': true, simply because
complex types with conditional members work fine.  Not worth breaking.

Reject conditional arguments unless boxed.

Move the tests cases covering unboxed conditional arguments out of
tests/qapi-schema/qapi-schema-test.json.  Cover boxed conditional
arguments there instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230316071325.492471-15-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2023-04-24 15:21:39 +02:00
..
_templates
about Revert "docs/about/deprecated: Deprecate 32-bit arm hosts for system emulation" 2023-03-24 12:10:49 +01:00
config docs/config: Set the "kvm" accelerator via "[accel]" section 2023-03-08 08:57:42 +01:00
devel qapi: Require boxed for conditional command and event arguments 2023-04-24 15:21:39 +02:00
interop docs: vhost-user: replace _SLAVE_ with _BACKEND_ 2023-03-02 03:10:47 -05:00
specs docs: Add support for TPM devices over I2C bus 2023-04-20 08:17:15 -04:00
sphinx docs/sphinx/kerneldoc.py: Honour --enable-werror 2023-03-16 14:39:10 +01:00
sphinx-static
spin
system * Compat machines for version 8.1 2023-04-21 12:31:46 +01:00
tools virtiofsd: Remove source 2023-02-16 18:15:08 +00:00
user docs: add hotlinks to about preface text 2023-02-02 10:44:23 +00:00
block-replication.txt
bypass-iommu.txt
COLO-FT.txt
colo-proxy.txt
conf.py virtiofsd: Remove build and docs glue 2023-02-16 18:15:08 +00:00
defs.rst.inc
igd-assign.txt
image-fuzzer.txt
index.rst
memory-hotplug.txt
meson.build docs/sphinx/kerneldoc.py: Honour --enable-werror 2023-03-16 14:39:10 +01:00
multi-thread-compression.txt
multiseat.txt
nvdimm.txt
pci_expander_bridge.txt
pcie_pci_bridge.txt
pcie_sriov.txt
pcie.txt docs/pcie.txt: Replace ioh3420 with pcie-root-port 2023-01-28 06:21:30 -05:00
pvrdma.txt
qcow2-cache.txt
qdev-device-use.txt util: remove support -chardev tty and -chardev parport 2023-01-06 00:51:02 +01:00
qemu-option-trace.rst.inc
qemupciserial.inf
rdma.txt
spice-port-fqdn.txt
throttle.txt
u2f.txt
xbzrle.txt
xen-save-devices-state.txt