« Previous | Next » 

Revision 69dd62df

ID69dd62dfd60631ba69201d8a197fde1ece4b4df3

Added by Kevin Wolf almost 11 years ago

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 <>
Reviewed-by: Eric Blake <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences