qemu/qapi
Kevin Wolf 69dd62dfd6 qapi: Anonymous unions
The discriminator for anonymous unions is the data type. This allows to
have a union type that allows both of these:

    { 'file': 'my_existing_block_device_id' }
    { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }

Unions like this are specified in the schema with an empty dict as
discriminator. For this example you could take:

    { 'union': 'BlockRef',
      'discriminator': {},
      'data': { 'definition': 'BlockOptions',
                'reference': 'str' } }
    { 'type': 'ExampleObject',
      'data: { 'file': 'BlockRef' } }

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2013-07-26 21:10:11 +02:00
..
Makefile.objs build: move base QAPI files to libqemuutil.a 2013-01-12 18:42:51 +01:00
opts-visitor.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qapi-dealloc-visitor.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qapi-visit-core.c qapi: Anonymous unions 2013-07-26 21:10:11 +02:00
qmp-dispatch.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
qmp-input-visitor.c qapi: Anonymous unions 2013-07-26 21:10:11 +02:00
qmp-output-visitor.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qmp-registry.c qapi: Fix unchecked strdup() by converting to g_strdup() 2013-01-30 11:14:46 +01:00
string-input-visitor.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
string-output-visitor.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00