qapi: allow unions to contain further unionspull-qapi-2023-04-26
commita17dbc4b79a28ffb9511f192474ffefd88214cde
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 20 Apr 2023 10:26:19 +0000 (20 11:26 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 26 Apr 2023 05:52:45 +0000 (26 07:52 +0200)
tree1a4fde556d2f94e3e908f4368ef9862d34340ef9
parent1e148b545fccc2a83a57269849de9a21e11c17da
qapi: allow unions to contain further unions

This extends the QAPI schema validation to permit unions inside unions,
provided the checks for clashing fields pass.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230420102619.348173-4-berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
12 files changed:
scripts/qapi/schema.py
tests/qapi-schema/meson.build
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/qapi-schema/union-invalid-union-subfield.err [new file with mode: 0644]
tests/qapi-schema/union-invalid-union-subfield.json [new file with mode: 0644]
tests/qapi-schema/union-invalid-union-subfield.out [new file with mode: 0644]
tests/qapi-schema/union-invalid-union-subtype.err [new file with mode: 0644]
tests/qapi-schema/union-invalid-union-subtype.json [new file with mode: 0644]
tests/qapi-schema/union-invalid-union-subtype.out [new file with mode: 0644]
tests/unit/test-qobject-input-visitor.c
tests/unit/test-qobject-output-visitor.c