diff options
author | Markus Armbruster <armbru@redhat.com> | 2019-09-13 22:13:43 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-09-24 14:07:22 +0200 |
commit | 0ced9531f17c1c28fa4f29b352729c7f40c2ae30 (patch) | |
tree | 01b884f181062407e78f158d48c4d085e438852b /docs/devel/qapi-code-gen.txt | |
parent | f03255362ae3bfd6f105c0fc855c713944f99717 (diff) |
qapi: Permit omitting all flat union branches
Absent flat union branches default to the empty struct (since commit
800877bb16 "qapi: allow empty branches in flat unions"). But an
attempt to omit all of them is rejected with "Union 'FOO' has no
branches". Harmless oddity, but it's easy to avoid, so do that.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190913201349.24332-11-armbru@redhat.com>
[Commit message typo fixed]
Diffstat (limited to 'docs/devel/qapi-code-gen.txt')
-rw-r--r-- | docs/devel/qapi-code-gen.txt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt index 4ce67752a7..ec2d374483 100644 --- a/docs/devel/qapi-code-gen.txt +++ b/docs/devel/qapi-code-gen.txt @@ -436,8 +436,7 @@ Union types are used to let the user choose between several different variants for an object. There are two flavors: simple (no discriminator or base), and flat (both discriminator and base). A union type is defined using a data dictionary as explained in the following -paragraphs. The data dictionary for either type of union must not -be empty. +paragraphs. Unions must have at least one branch. A simple union type defines a mapping from automatic discriminator values to data types like in this example: |