summary refs log tree commit diff stats
path: root/docs/qapi-code-gen.txt
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-12 10:47:07 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-12 10:47:07 +0000
commit613c12ec28573b10cae0cd91139ba69b964f347c (patch)
treeb66907dde9f7aa0bf57503fea2be092b43d26e56 /docs/qapi-code-gen.txt
parentbe813ef02d18ba58e1ff32f1706bcacb88f1f764 (diff)
parent2a7a1a56d1e30de07cf7d7636a35bf7706b9500e (diff)
downloadfocaccia-qemu-613c12ec28573b10cae0cd91139ba69b964f347c.tar.gz
focaccia-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/qapi-code-gen.txt')
-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',