summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorPeter Maydell2014-03-12 11:47:07 +0100
committerPeter Maydell2014-03-12 11:47:07 +0100
commit613c12ec28573b10cae0cd91139ba69b964f347c (patch)
treeb66907dde9f7aa0bf57503fea2be092b43d26e56 /docs
parentMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (diff)
parenttests: test-qmp-commands: Fix double free (diff)
downloadqemu-613c12ec28573b10cae0cd91139ba69b964f347c.tar.gz
qemu-613c12ec28573b10cae0cd91139ba69b964f347c.tar.xz
qemu-613c12ec28573b10cae0cd91139ba69b964f347c.zip
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: tests: test-qmp-commands: Fix double free qapi script: do not add "_" for every capitalized char in enum qapi script: do not allow string discriminator qapi: convert BlockdevOptions to use enum discriminator qapi script: support enum type as discriminator in union qapi script: use same function to generate enum string qapi script: code move for generate_enum_name() qapi script: check correctness of union qapi script: remember line number in schema parsing qapi script: add check for duplicated key qapi script: remember explicitly defined enum values Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/qapi-code-gen.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt
index 0728f36c65..d78921f875 100644
--- a/docs/qapi-code-gen.txt
+++ b/docs/qapi-code-gen.txt
@@ -123,11 +123,12 @@ And it looks like this on the wire:
Flat union types avoid the nesting on the wire. They are used whenever a
specific field of the base type is declared as the discriminator ('type' is
-then no longer generated). The discriminator must always be a string field.
+then no longer generated). The discriminator must be of enumeration type.
The above example can then be modified as follows:
+ { 'enum': 'BlockdevDriver', 'data': [ 'raw', 'qcow2' ] }
{ 'type': 'BlockdevCommonOptions',
- 'data': { 'driver': 'str', 'readonly': 'bool' } }
+ 'data': { 'driver': 'BlockdevDriver', 'readonly': 'bool' } }
{ 'union': 'BlockdevOptions',
'base': 'BlockdevCommonOptions',
'discriminator': 'driver',