From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVfec-0000dQ-6g for qemu-devel@nongnu.org; Fri, 26 Apr 2013 06:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVfea-0004E1-Oi for qemu-devel@nongnu.org; Fri, 26 Apr 2013 06:13:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVfea-0004CO-Hc for qemu-devel@nongnu.org; Fri, 26 Apr 2013 06:13:20 -0400 Date: Fri, 26 Apr 2013 18:12:19 +0800 From: Amos Kong Message-ID: <20130426101219.GA1824@t430s.nay.redhat.com> References: <20130419052612.GA10011@t430s.nay.redhat.com> <1366819685-24106-1-git-send-email-akong@redhat.com> <20130424164625.GC27849@vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130424164625.GC27849@vm> Subject: Re: [Qemu-devel] [PATCH v2] qapi: add struct strList and visit_type_strList() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mdroth Cc: stefanha@gmail.com, aliguori@us.ibm.com, pbonzini@redhat.com, qemu-devel@nongnu.org, vilanova@ac.upc.edu 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 > > 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.