On 07/09/2013 03:53 AM, Kevin Wolf wrote: > The new 'base' key in a union definition refers to a struct type, which > is inlined into the union definition and can represent fields common to > all kinds.
Is it worth listing an example of intended use in the commit message? If I understand correctly, then this qapi-schema.json file: { 'type': 'Base', 'data': { 'main': 'str' } } { 'type': 'Extra1', 'data': { 'foo': 'str' } } { 'type': 'Extra2', 'data': { 'bar': 'str' } } { 'union': 'Type', 'base': 'BaseType', 'data': { 'variant1': 'Extra1', 'variant2': 'Extra2' } } { 'command': 'test', 'data': { 'arg': 'Type' } } would then be used over the wire as: { "execute": "test", "arguments": { "arg": { "type": "variant1", "data": { "main": "hello", "foo": "world" } } } } { "execute": "test", "arguments": { "arg": { "type": "variant2", "data": { "main": "hi", "bar": "there" } } } } > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > scripts/qapi-types.py | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) I'm slowly learning python, so my review skills are still weak the more complicated the changes are; but this seems easy enough to understand. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature