From: Amos Kong <akong@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org,
lcapitulino@redhat.com, qiaonuohan@cn.fujitsu.com,
pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP
Date: Mon, 23 Dec 2013 15:15:03 +0800 [thread overview]
Message-ID: <20131223071503.GA28470@amosk.info> (raw)
In-Reply-To: <52B7D90E.50400@linux.vnet.ibm.com>
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 there still exists some problem.
> >
> >We should describe some arbitrary data struct, I would like to call it "undefined struct"
> >
> If user have defined an arbitrary or embbed data struct, I think it
> is better leave as it is, instead of generate a new struct for it.
I don't really generate a new struct for it, just try the arbitrary
data as an abstract 'undefined' struct.
In the output, it's "leave as it is".
> Since qapi-visit.c and qapi-types.c doesn't have a "undefined" struct
> for it now, it is a bit risk to do it only in QMP introspection. Maybe
> leave it now, and support it when we found it is really useful?(and add
> it in qapi-visit.c and qapi-types.c correspondly)
>
> >eg 1:
> > { 'type': 'VersionInfo',
> > 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
> > 'package': 'str'} }
> > it's same as:
> > { 'type': 'newtype',
> > 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
> > { 'type': 'VersionInfo',
> > 'data': { 'qemu': 'newtype', 'package': 'str'} }
> >
> > The difference between original 'DataObjectType' and 'DataObjectUndefinedStruct'
> > is that we don't have 'name' for the DataObject union for undefined struct.
> > so I set the 'name' item in DataObjectBase to be optional.
> >
> >eg 2:
> > { 'command': 'human-monitor-command',
> > 'data': {'command-line': 'str', '*cpu-index': 'int'},
> > 'returns': 'str' }
> > ... 'returns': ['RxFilterInfo'] }
> > ... 'returns': 'ChardevReturn' }
> >
> > We returns str (native type), list or extended dict here. Sometimes we
> > returns a defined type, but it doesn't need to be extended. And we need
> > to describe this kind of data (type str, dict or list) by "DataObject"
> > in schema definition of DataObject** type.
> >
> > So I added a "'reference-type': 'String'" in DataObject union.
> > list, dict will still be described by "DataObjectType"
> >
> I guess you want to tip what type may be returned? It seems a bit too
> agressive, since the qapi-schema.json didn't tip that those types may
> be returned.
In command schema, the value of 'returns' tips the model of return data.
It can be string(defined type/union/enum/etc) or undefined list/dict.
> >You can find the draft patches here:
> > https://github.com/kongove/qemu/commits/qmp-introspection
> >I will post the V3 when I finish the cleanup.
--
Amos.
prev parent reply other threads:[~2013-12-23 7:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-16 10:37 [Qemu-devel] [PATCH v2 0/2] QMP full introspection Amos Kong
2013-07-16 10:37 ` [Qemu-devel] [PATCH v2 1/2] qapi: change qapi to convert schema json Amos Kong
2013-07-17 20:09 ` Luiz Capitulino
2013-07-26 3:39 ` Amos Kong
2013-07-19 12:27 ` Eric Blake
2013-07-26 6:53 ` Amos Kong
2013-07-16 10:37 ` [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP Amos Kong
2013-07-16 10:48 ` Paolo Bonzini
2013-07-16 11:04 ` Amos Kong
2013-07-16 11:08 ` Paolo Bonzini
2013-07-16 12:04 ` Amos Kong
2013-07-16 12:18 ` Paolo Bonzini
2013-07-26 7:03 ` Amos Kong
2013-07-17 20:36 ` Luiz Capitulino
2013-07-19 20:26 ` Eric Blake
2013-07-26 7:21 ` Amos Kong
2013-07-19 22:05 ` Eric Blake
2013-07-26 7:51 ` Amos Kong
2013-07-26 11:52 ` Eric Blake
2013-11-27 2:32 ` Amos Kong
2013-11-27 9:51 ` Kevin Wolf
[not found] ` <20131220110001.GC2890@amosk.info>
2013-12-20 11:57 ` Amos Kong
2013-12-20 18:03 ` Paolo Bonzini
2013-12-23 8:11 ` Amos Kong
2013-12-23 6:32 ` Wenchao Xia
2013-12-23 7:15 ` Amos Kong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131223071503.GA28470@amosk.info \
--to=akong@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qiaonuohan@cn.fujitsu.com \
--cc=xiawenc@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).