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

2013-12-23 Thread Amos Kong
On Fri, Dec 20, 2013 at 07:03:57PM +0100, Paolo Bonzini wrote: > Il 20/12/2013 12:57, Amos Kong ha scritto: > > { 'type': 'DataObjectBase', > > 'data': { '*name': 'str', 'type': 'str' } } > > { 'union': 'DataObjectMemberType', > > 'discriminator': {}, > > 'data': { 'reference': 'str', > >

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

2013-12-22 Thread Amos Kong
On Mon, Dec 23, 2013 at 02:32:46PM +0800, Wenchao Xia wrote: > Hi, Amos > > >(resend without big attachment) > > > >Hello Eric, other > > > >We had "command, enumeration, type, unionobj" in Eric suggested DataObject > >union, it's helpful for us to provide meaningful metadata in the output. > >but

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

2013-12-22 Thread Wenchao Xia
Hi, Amos (resend without big attachment) Hello Eric, other We had "command, enumeration, type, unionobj" in Eric suggested DataObject union, it's helpful for us to provide meaningful metadata in the output. but there still exists some problem. We should describe some arbitrary data struct, I

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

2013-12-20 Thread Paolo Bonzini
Il 20/12/2013 12:57, Amos Kong ha scritto: > { 'type': 'DataObjectBase', > 'data': { '*name': 'str', 'type': 'str' } } > { 'union': 'DataObjectMemberType', > 'discriminator': {}, > 'data': { 'reference': 'str', > 'undefined': 'DataObject', > 'extend': 'DataObject' } }

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

2013-12-20 Thread Amos Kong
(resend without big attachment) Hello Eric, other We had "command, enumeration, type, unionobj" in Eric suggested DataObject union, it's helpful for us to provide meaningful metadata in the output. but there still exists some problem. We should describe some arbitrary data struct, I would like t

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

2013-11-27 Thread Kevin Wolf
Am 27.11.2013 um 03:32 hat Amos Kong geschrieben: > On Fri, Jul 19, 2013 at 04:05:16PM -0600, Eric Blake wrote: > > On 07/16/2013 04:37 AM, Amos Kong wrote: > > > { 'type': 'DataObject', > > > 'data': { '*key': 'str', '*type': 'str', '*data': ['DataObject'] } } > > > > > > Not all the keys in da

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

2013-11-26 Thread Amos Kong
On Fri, Jul 19, 2013 at 04:05:16PM -0600, Eric Blake wrote: > On 07/16/2013 04:37 AM, Amos Kong wrote: > > Introduces new monitor command to query QMP schema information, > > the return data is a dynamical and nested dict/list, it contains > > s/dynamical/dynamic/ > > > the useful metadata to hel

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

2013-07-26 Thread Eric Blake
On 07/26/2013 01:51 AM, Amos Kong wrote: >>> +# Query QMP schema information >>> +# >>> +# Returns: list of @SchemaEntry. Returns an error if json string is >>> invalid. >> >> If you don't take any arguments, then the "returns an error" statement >> is impossible. > > When we execute the full in

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

2013-07-26 Thread Amos Kong
On Fri, Jul 19, 2013 at 04:05:16PM -0600, Eric Blake wrote: > On 07/16/2013 04:37 AM, Amos Kong wrote: > > Introduces new monitor command to query QMP schema information, > > the return data is a dynamical and nested dict/list, it contains > > s/dynamical/dynamic/ > > > the useful metadata to hel

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

2013-07-26 Thread Amos Kong
On Wed, Jul 17, 2013 at 04:36:06PM -0400, Luiz Capitulino wrote: > On Tue, 16 Jul 2013 18:37:42 +0800 > Amos Kong wrote: > > > Introduces new monitor command to query QMP schema information, > > the return data is a dynamical and nested dict/list, it contains > > the useful metadata to help manag

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

2013-07-26 Thread Amos Kong
On Tue, Jul 16, 2013 at 02:18:37PM +0200, Paolo Bonzini wrote: > 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 li

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

2013-07-19 Thread Eric Blake
On 07/17/2013 02:36 PM, Luiz Capitulino wrote: >> We need to parse all commands json definition, and generated a >> dynamical tree, QMP infrastructure will convert the tree to >> json string and return to QMP client. >> >> So here I defined a 'DataObject' type in qapi-schema.json, >> it's used to d

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

2013-07-19 Thread Eric Blake
On 07/16/2013 04:37 AM, Amos Kong wrote: > Introduces new monitor command to query QMP schema information, > the return data is a dynamical and nested dict/list, it contains s/dynamical/dynamic/ > the useful metadata to help management to check feature support, > QMP commands detail, etc. > > I

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

2013-07-17 Thread Luiz Capitulino
On Tue, 16 Jul 2013 18:37:42 +0800 Amos Kong wrote: > Introduces new monitor command to query QMP schema information, > the return data is a dynamical and nested dict/list, it contains > the useful metadata to help management to check feature support, > QMP commands detail, etc. > > I added a do

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

2013-07-16 Thread Paolo Bonzini
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,

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

2013-07-16 Thread Amos Kong
On Tue, Jul 16, 2013 at 01:08:55PM +0200, Paolo Bonzini wrote: > Il 16/07/2013 13:04, 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', > >>> >

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

2013-07-16 Thread Paolo Bonzini
Il 16/07/2013 13:04, 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'] } } >

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

2013-07-16 Thread Amos Kong
On Tue, Jul 16, 2013 at 12:48:36PM +0200, Paolo Bonzini wrote: > 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',

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

2013-07-16 Thread Paolo Bonzini
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': '

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

2013-07-16 Thread Amos Kong
Introduces new monitor command to query QMP schema information, the return data is a dynamical and nested dict/list, it contains the useful metadata to help management to check feature support, QMP commands detail, etc. I added a document for QMP introspection support. (docs/qmp-full-introspection