qemu-devel
[Top][All Lists]
Advanced

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

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


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP
Date: Tue, 16 Jul 2013 14:18:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 16/07/2013 14:04, Amos Kong ha scritto:
>> > Thanks.  I see this is unique, but it is also not too intuitive.
>> > 
>> > So, could you add a "kind" field to DataObject that is an enum
>> > (list/dict/scalar, or something like that)?  This would make it easier
>> > to parse (for humans at least, but I guess also for programs).
> I thought we can identify the kind by some judgment.

Yes, I understood that.  Strictly speaking the kind is redundant, but it
seems to me that it makes the API easier to understand and use.

>  if the dict has key 'key', it's a dict
>  if no 'key', have 'type', it's a list
>  if only have 'type', it's a buildin type (or extended type that
>    doesn't need to be extended)
>  if no 'key', have 'type' & 'data', it's extended list type
>  if have 'key', 'type', 'data', it's extended dict type
> 
> I will added a 'kind' field to make it clearer.
> 
> KIND enum:
>   list
>   dict
>   str

Why "str" and not "scalar" for a builtin type?  It's not necessarily a
string, is it?

Paolo

> scalar(bool):   Or just simplely check if have 'data' key?
>   true/false




reply via email to

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