From: Amos Kong <akong@redhat.com>
To: mdroth <mdroth@linux.vnet.ibm.com>
Cc: stefanha@gmail.com, aliguori@us.ibm.com, pbonzini@redhat.com,
qemu-devel@nongnu.org, vilanova@ac.upc.edu
Subject: Re: [Qemu-devel] [PATCH v2] qapi: add struct strList and visit_type_strList()
Date: Fri, 26 Apr 2013 18:12:19 +0800 [thread overview]
Message-ID: <20130426101219.GA1824@t430s.nay.redhat.com> (raw)
In-Reply-To: <20130424164625.GC27849@vm>
Hi Michael,
On Wed, Apr 24, 2013 at 11:46:25AM -0500, mdroth wrote:
> On Thu, Apr 25, 2013 at 12:08:05AM +0800, Amos Kong wrote:
> > Currently we can only use ['String'] to add string to a list,
> > it contains some additional JSON structure.
> > "multicast": [
> > {
> > "str": "01:80:c2:00:00:21"
> > },
> > {
> > "str": "00:00:00:00:00:00"
> > }
> > ]
> >
> > This patch adds struct strList and visit function, we can use ['str'] in
> > schema file.
> >
> > "multicast": [
> > "01:00:5e:00:00:01",
> > "33:33:ff:12:34:57"
> > ]
> >
> > V2: remove ugly #ifndef, add forward declaration in qapi-types.h,
> > and define the struct in include/qapi/visitor.h (Paolo)
> >
> > Signed-off-by: Amos Kong <akong@redhat.com>
>
> Sorry for the delay in getting back to you, I started to respond last
> week and ended up hacking something up that take a different approach.
>
> Namely: we don't hardcode visit_type_strList(), but instead teach the
> qapi code generators about native types we currently allow in schemas
> ('str', 'int', 'number', 'bool') and have them handle code generation
> for these like they would for any user-defined type.
It's better.
> This approach works too, but I think this solution is more complete.
> I'm still working out some bits with the unit tests but I've pushed my
> WIP here for reference:
>
> https://github.com/mdroth/qemu/commits/qapi-native-lists
>
> Please give that a shot.
Your patchset looks good to me, I only added some trivial comments on
github.
--
Amos.
prev parent reply other threads:[~2013-04-26 10:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 20:04 [Qemu-devel] [qapi] Cannot use list of strings Lluís Vilanova
2013-04-15 21:07 ` Lluís Vilanova
2013-04-16 8:49 ` Stefan Hajnoczi
2013-04-16 8:54 ` Paolo Bonzini
2013-04-16 10:13 ` Amos Kong
2013-04-16 12:36 ` Eric Blake
2013-04-16 10:46 ` Lluís Vilanova
2013-04-16 14:50 ` mdroth
2013-04-17 8:33 ` Amos Kong
2013-04-19 5:26 ` [Qemu-devel] [RFC PATCH] qapi: introduce strList and visit_type_strList() (was Re: [qapi] Cannot use list of strings) Amos Kong
2013-04-24 16:08 ` [Qemu-devel] [PATCH v2] qapi: add struct strList and visit_type_strList() Amos Kong
2013-04-24 16:11 ` Paolo Bonzini
2013-04-24 16:48 ` Amos Kong
2013-04-24 16:46 ` mdroth
2013-04-26 10:12 ` 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=20130426101219.GA1824@t430s.nay.redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=vilanova@ac.upc.edu \
/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).