qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] full introspection support for QMP


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] full introspection support for QMP
Date: Tue, 02 Jul 2013 10:39:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 06/19/2013 06:49 AM, Amos Kong wrote:
> On Wed, Jun 19, 2013 at 08:24:37PM +0800, Amos Kong wrote:
>> Introduces new monitor command to query QMP schema information,
>> the return data is a nested dict/list, it contains the useful
>> metadata.
>>
>> we can add events definations to qapi-schema.json, then it can
>> also be queried.
>  
> I didn't implement to return complete schema in one go in this
> version, will do it in next version. We have a recursive define
> 'DataObject', we only display one layer for it.

Yes, for recursive definitions, we have to stop somewhere.


> 
> You can find three kind of examples(string/list/dict) in the bottom.
> Attached (query-qmp-schema--output.txt) the full output of execut 
> query-qmp-schema command.
> 
> String:
> { 'command': 'query-name', 'returns': 'NameInfo' }
> ---------------------------------------------------------------------
>         {
>             "name": "NameInfo",
>             "type": "Type",
>             "data": [
>                 {
>                     "name": "*name",
>                     "type": "str"
>                 }
>             ]
>         },

This output still requires post-processing - the user has to parse the
key "*name" to learn two bits of information - whether the parameter is
optional, and the fact that it is named "name" not "*name".  I _still_
argue that we want to return 3 things, not two, as in:

            "data": [
                {
                    "name": "name",
                    "optional": true,
                    "type": "str"
                }
            ]

-- 
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]