Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)

2013-06-18 Thread Amos Kong
On Fri, Jun 14, 2013 at 12:09:33PM +0100, Eric Blake wrote: > On 06/14/2013 10:52 AM, Amos Kong wrote: > > +const char *type; > > +const char *name; > > +const char *data; > > +const char *returns; > > +} qmp_schema_table[] = { > > +""" > > + > > +for i in exprs_all[1]: > > +print i > > + > >

Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)

2013-06-14 Thread Eric Blake
On 06/14/2013 10:52 AM, Amos Kong wrote: >>From 2b39fe0f380eea6a96de3589b3d148673d28c1ff Mon Sep 17 00:00:00 2001 > From: Amos Kong > Date: Fri, 7 Jun 2013 18:02:21 +0800 > Subject: [PATCH] full introspection support for QMP > > Signed-off-by: Amos Kong > --- > qapi-schema.json | 6 ++

Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)

2013-06-14 Thread Eric Blake
On 06/14/2013 10:52 AM, Amos Kong wrote: > On Fri, Jun 07, 2013 at 06:17:26PM +0800, Amos Kong wrote: >> On Fri, Jun 07, 2013 at 06:12:30PM +0800, Amos Kong wrote: >>> Sent out a draft patch in the end of this week. It doesn't support: >>> * output all stuffs in one shot. >>> * introspect event >>>

Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)

2013-06-07 Thread Amos Kong
On Fri, Jun 07, 2013 at 06:12:30PM +0800, Amos Kong wrote: > Sent out a draft patch in the end of this week. It doesn't support: > * output all stuffs in one shot. > * introspect event > * provide metadata date > > How can we define a dynamic dict in qmp-schema.json ? > > Currently I just output

Re: [Qemu-devel] RFC: Full introspection support for QMP (with draft patch)

2013-06-07 Thread Amos Kong
Sent out a draft patch in the end of this week. It doesn't support: * output all stuffs in one shot. * introspect event * provide metadata date How can we define a dynamic dict in qmp-schema.json ? Currently I just output the raw json dict by a string, Libvirt needs parse two times, convert the s

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Kevin Wolf
Am 23.05.2013 um 15:52 hat Anthony Liguori geschrieben: > Kevin Wolf writes: > > > Am 23.05.2013 um 14:08 hat Anthony Liguori geschrieben: > >> Kevin Wolf writes: > >> > >> > >> There are two things here: the schema and the generated code. The > >> generated code can and should live in the mo

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Eric Blake
On 05/23/2013 07:52 AM, Anthony Liguori wrote: >> libvirt already knows how to use features. It must know it, just parsing >> the schema doesn't automagically give you libvirt code, so someone must >> have coded the libvirt side of things. The interesting part is whether a >> given interface is ava

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Anthony Liguori
Kevin Wolf writes: > Am 23.05.2013 um 14:08 hat Anthony Liguori geschrieben: >> Kevin Wolf writes: >> >> >> There are two things here: the schema and the generated code. The >> generated code can and should live in the module. >> >> But the schema always stays the same. >> >> Think of the s

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Eric Blake
On 05/22/2013 07:40 AM, Amos Kong wrote: > Hi all, > > We already have query-command-line-options to query details of command-line > options. As we discussed in the list, we also need full introspection of QMP > (command). The qmp-events also need to be dumped, we can define events in > qai-schema

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Kevin Wolf
Am 23.05.2013 um 14:08 hat Anthony Liguori geschrieben: > Kevin Wolf writes: > > > Am 22.05.2013 um 18:14 hat Anthony Liguori geschrieben: > >> Kevin Wolf writes: > >> > For example, libvirt wants to query which block drivers it can use. It > >> > doesn't really matter for which drivers we had t

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Anthony Liguori
Luiz Capitulino writes: > On Thu, 23 May 2013 07:08:59 -0500 > Anthony Liguori wrote: > >> > then we don't need introspection at all. There's no user for it then. >> >> Introspection is not the right approach to feature discovery. The >> schema does answer the question of what features are ena

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Luiz Capitulino
On Thu, 23 May 2013 07:08:59 -0500 Anthony Liguori wrote: > > then we don't need introspection at all. There's no user for it then. > > Introspection is not the right approach to feature discovery. The > schema does answer the question of what features are enabled, it just > answers the questio

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Anthony Liguori
Kevin Wolf writes: > Am 22.05.2013 um 18:14 hat Anthony Liguori geschrieben: >> Kevin Wolf writes: >> > For example, libvirt wants to query which block drivers it can use. It >> > doesn't really matter for which drivers we had the source initially, but >> > only which drivers are compiled in (po

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-23 Thread Kevin Wolf
Am 22.05.2013 um 18:14 hat Anthony Liguori geschrieben: > Kevin Wolf writes: > > > Am 22.05.2013 um 15:40 hat Amos Kong geschrieben: > >> Hi all, > >> > >> We already have query-command-line-options to query details of command-line > >> options. As we discussed in the list, we also need full int

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-22 Thread Luiz Capitulino
On Wed, 22 May 2013 21:40:07 +0800 Amos Kong wrote: > Hi all, > > We already have query-command-line-options to query details of command-line > options. As we discussed in the list, we also need full introspection of QMP > (command). The qmp-events also need to be dumped, we can define events in

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-22 Thread Anthony Liguori
Kevin Wolf writes: > Am 22.05.2013 um 15:40 hat Amos Kong geschrieben: >> Hi all, >> >> We already have query-command-line-options to query details of command-line >> options. As we discussed in the list, we also need full introspection of QMP >> (command). The qmp-events also need to be dumped,

Re: [Qemu-devel] RFC: Full introspection support for QMP

2013-05-22 Thread Kevin Wolf
Am 22.05.2013 um 15:40 hat Amos Kong geschrieben: > Hi all, > > We already have query-command-line-options to query details of command-line > options. As we discussed in the list, we also need full introspection of QMP > (command). The qmp-events also need to be dumped, we can define events in > q

[Qemu-devel] RFC: Full introspection support for QMP

2013-05-22 Thread Amos Kong
Hi all, We already have query-command-line-options to query details of command-line options. As we discussed in the list, we also need full introspection of QMP (command). The qmp-events also need to be dumped, we can define events in qai-schema.json. We can also dump QMP errors in future if it's