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 12:48:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 16/07/2013 12:37, Amos Kong ha scritto:
> So here I defined a 'DataObject' type in qapi-schema.json,
> it's used to describe the dynamical dictionary/list/string.
> 
> { 'type': 'DataObject',
>   'data': { '*key': 'str', '*type': 'str', '*data': ['DataObject'] } }

This is missing '*optional': 'bool'.  Also, how do you distinguish these:

  { 'command': 'query-tpm-types', 'returns': 'TpmType] }
  { 'command': 'query-tpm-types', 'returns': ['TpmType'] }

Could it have to be like this?

   'data': { '*key': 'str', '*type': 'str', '*list': 'bool',
             '*optional': 'bool',
             '*data': ['DataObject'] } }

Can you document, in the commit message or the code, how you avoid
infinite loops (possible with optional or list fields)?

Paolo

> Not all the keys in data will be used.
>  # List: type
>  # Dict: key, type
>  # nested List: type, data
>  # nested Dict: key, type, data
> 
> The DataObject is described in docs/qmp-full-introspection.txt in
> detail.
> 
> The following content gives an example of query-tpm-types:
> 
>  ## Define example in qapi-schema.json:
> 
>  { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
>  { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
> 
>  ## Returned description:
> 
>  {
>      "name": "query-tpm-types",
>      "type": "Command",
>      "returns": [
>          {
>              "type": "TpmType",
>              "data": [
>                  {
>                      "type": "passthrough"
>                  }
>              ]
>          }
>      ]
>  },




reply via email to

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