qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v3 30/32] qapi: New QMP command query-schema


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v3 30/32] qapi: New QMP command query-schema for QMP schema introspection
Date: Mon, 24 Aug 2015 10:51:37 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

On 08/24/2015 07:07 AM, Eric Blake wrote:

> Where things would NOT be allowed due to our prohibition of nested
> structs is:
> 
> { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type',
>   'data': { 'okay': 'str', 'bad': { 'i': 'int' } } }

I typed that wrong.

{ 'union': 'Flat', 'base': 'Base', 'discriminator': 'type',
  'data': { 'branch1': 'NamedTypeOkay',
            'branch2': { 'anon-type-okay': 'str' },
            'branch3': { 'okay': str', 'bad-nesting': { 'i': 'int' } } } }

and where anonymous types are still okay is that if we add long-hand for
expressing optional types, or otherwise use a dict in place of a type,
we can do:

{ 'union': 'Flat', 'base': 'Base', 'discriminator': 'type',
  'data': { 'branch1': 'NamedTypeOkay',
    'branch2': { 'anon-type-okay': { 'type': 'str',
                      'optional': true } } } }
,
That is, there is a difference between the dictionary expressing an
anonymous type, and the dictionary expressing additional attributes
belonging to a member of a struct.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]