summaryrefslogtreecommitdiff
path: root/include/qapi/visitor-impl.h
AgeCommit message (Collapse)AuthorFilesLines
2013-07-26qapi: Anonymous unionsKevin Wolf1-0/+2
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-26qapi: Add visitor for implicit structsKevin Wolf1-0/+4
These can be used when an embedded struct is parsed and members not belonging to the struct may be present in the input (e.g. parsing a flat namespace QMP union, where fields from both the base and one of the alternative types are mixed in the JSON object) Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2012-12-19qapi: move include files to include/qobject/Paolo Bonzini1-0/+63
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>