mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-24 00:18:36 -07:00
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>
|
||
|---|---|---|
| .. | ||
| dispatch.h | ||
| json-lexer.h | ||
| json-parser.h | ||
| json-streamer.h | ||
| qbool.h | ||
| qdict.h | ||
| qerror.h | ||
| qfloat.h | ||
| qint.h | ||
| qjson.h | ||
| qlist.h | ||
| qobject.h | ||
| qstring.h | ||
| types.h | ||