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
signature.asc
Description: OpenPGP digital signature