qemu-e2k/docs/devel
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
..
acpi-bits.rst docs/acpi/bits: document BITS_DEBUG environment variable 2022-12-21 07:32:24 -05:00
atomics.rst docs: explain effect of smp_read_barrier_depends() on modern architectures 2023-04-20 11:17:36 +02:00
bitops.rst
blkdebug.txt
blkverify.txt
block-coroutine-wrapper.rst block-coroutine-wrapper.py: introduce co_wrapper 2022-12-15 16:07:43 +01:00
build-system.rst
ci-definitions.rst.inc
ci-jobs.rst.inc
ci-runners.rst.inc
ci.rst
clocks.rst
code-of-conduct.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
conflict-resolution.rst
control-flow-integrity.rst
decodetree.rst
ebpf_rss.rst
fuzzing.rst docs/fuzz: remove mentions of fork-based fuzzing 2023-02-16 23:02:46 -05:00
index-api.rst
index-build.rst acpi/tests/avocado/bits/doc: add a doc file to describe the acpi bits test 2022-11-02 06:56:32 -04:00
index-internals.rst
index-process.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
index-tcg.rst tcg: convert tcg/README to rst 2023-01-04 16:20:01 -08:00
index.rst
kconfig.rst docs/devel/kconfig.rst: Fix incorrect markup 2023-04-20 10:21:16 +01:00
loads-stores.rst
lockcnt.txt
maintainers.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
memory.rst
migration.rst migration: Split save_live_pending() into state_pending_* 2023-02-06 19:22:56 +01:00
modules.rst
multi-process.rst
multi-thread-tcg.rst
multiple-iothreads.txt
qapi-code-gen.rst qapi: Require boxed for conditional command and event arguments 2023-04-24 15:21:39 +02:00
qgraph.rst
qom.rst
qtest.rst
rcu.txt
replay.rst
reset.rst
s390-dasd-ipl.rst
secure-coding-practices.rst
stable-process.rst
style.rst docs/devel: Rules on #include in headers 2023-01-08 01:54:22 -05:00
submitting-a-patch.rst docs/devel: try and improve the language around patch review 2022-11-22 09:52:23 +00:00
submitting-a-pull-request.rst docs/devel: add a maintainers section to development process 2022-11-22 09:49:07 +00:00
tcg-icount.rst
tcg-ops.rst docs/devel/tcg-ops: Drop recommendation to free temps 2023-03-05 13:44:08 -08:00
tcg-plugins.rst docs: add a new section to outline emulation support 2023-02-02 10:44:23 +00:00
tcg.rst tcg: add perfmap and jitdump 2023-01-16 10:14:12 -10:00
testing.rst testing: update ubuntu2004 to ubuntu2204 2023-03-01 10:31:46 +00:00
tracing.rst
trivial-patches.rst
ui.rst
vfio-migration.rst docs/devel: Document VFIO device dirty page tracking 2023-03-07 10:21:22 -07:00
virtio-backends.rst
virtio-migration.txt
writing-monitor-commands.rst qapi: Start to elide redundant has_FOO in generated C 2022-12-13 18:31:37 +01:00