From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StnUC-0007E8-Dd for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StnUB-0006Vp-E4 for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:21:48 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:40645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StnUB-0006Vl-A2 for qemu-devel@nongnu.org; Tue, 24 Jul 2012 18:21:47 -0400 Received: from /spool/local by e6.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jul 2012 18:21:46 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 173A2C9001C for ; Tue, 24 Jul 2012 18:21:44 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6OMLiYS331252 for ; Tue, 24 Jul 2012 18:21:44 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6OMLhWg028798 for ; Tue, 24 Jul 2012 18:21:43 -0400 From: Anthony Liguori In-Reply-To: <1343150454-4677-9-git-send-email-mdroth@linux.vnet.ibm.com> References: <1343150454-4677-1-git-send-email-mdroth@linux.vnet.ibm.com> <1343150454-4677-9-git-send-email-mdroth@linux.vnet.ibm.com> Date: Tue, 24 Jul 2012 17:21:40 -0500 Message-ID: <87y5m8kdfv.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 08/22] qapi: qapi_visit.py, support for visiting non-pointer/embedded structs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth , qemu-devel@nongnu.org Cc: quintela@redhat.com, owasserm@redhat.com, yamahata@valinux.co.jp, pbonzini@redhat.com, akong@redhat.com, afaerber@suse.de Michael Roth writes: Reviewed-by: Anthony Liguori Regards, Anthony Liguori > Signed-off-by: Michael Roth > --- > scripts/qapi_visit.py | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/scripts/qapi_visit.py b/scripts/qapi_visit.py > index 864acb2..8f8cdca 100644 > --- a/scripts/qapi_visit.py > +++ b/scripts/qapi_visit.py > @@ -105,6 +105,15 @@ if (obj && (*obj)->%(prefix)shas_%(c_name)s) { > if annotated: > if isinstance(argentry['type'], types.ListType): > ret += generate_visit_array_body(argname, argentry) > + elif argentry.has_key(''): > + tmp_ptr_name = "%s_%s_ptr" % (c_var(field_prefix).replace(".", ""), c_var(argname)) > + ret += mcgen(''' > +%(type)s *%(tmp_ptr)s = &(*obj)->%(c_prefix)s%(c_name)s; > +visit_type_%(type)s(m, (obj && *obj) ? &%(tmp_ptr)s : NULL, "%(name)s", errp); > +''', > + c_prefix=c_var(field_prefix), prefix=field_prefix, > + type=type_name(argentry['type']), c_name=c_var(argname), > + name=argname, tmp_ptr=tmp_ptr_name) > else: > ret += mcgen(''' > visit_type_%(type)s(m, obj ? &(*obj)->%(c_prefix)s%(c_name)s : NULL, "%(name)s", errp); > -- > 1.7.9.5