]> Git Repo - qemu.git/commit - docs/qapi-code-gen.txt
qapi script: support enum type as discriminator in union
authorWenchao Xia <[email protected]>
Fri, 7 Mar 2014 01:08:56 +0000 (17:08 -0800)
committerLuiz Capitulino <[email protected]>
Tue, 11 Mar 2014 13:07:42 +0000 (09:07 -0400)
commitbceae7697ff1711675c26f715b945737bc6849ae
treeb528a35656db4d66e9c5be5be54edc7cbeb79344
parentb0b58195e4a3039b6a473124dc27ed707db50240
qapi script: support enum type as discriminator in union

By default, any union will automatically generate a enum type as
"[UnionName]Kind" in C code, and it is duplicated when the discriminator
is specified as a pre-defined enum type in schema. After this patch,
the pre-defined enum type will be really used as the switch case
condition in generated C code, if discriminator is an enum field.

Signed-off-by: Wenchao Xia <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
docs/qapi-code-gen.txt
scripts/qapi-types.py
scripts/qapi-visit.py
scripts/qapi.py
tests/Makefile
tests/qapi-schema/flat-union-reverse-define.err [new file with mode: 0644]
tests/qapi-schema/flat-union-reverse-define.exit [new file with mode: 0644]
tests/qapi-schema/flat-union-reverse-define.json [new file with mode: 0644]
tests/qapi-schema/flat-union-reverse-define.out [new file with mode: 0644]
This page took 0.026287 seconds and 4 git commands to generate.