Received: from eggs.gnu.org ([208.118.235.92]:52054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2sT-0004E6-R3 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:49:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV2sS-0006sn-Jh for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:49:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2sS-0006ru-Bv for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:49:04 -0400 Date: Thu, 25 Apr 2013 00:48:55 +0800 From: Amos Kong Message-ID: <20130424164855.GB3005@t430s.nay.redhat.com> References: <20130419052612.GA10011@t430s.nay.redhat.com> <1366819685-24106-1-git-send-email-akong@redhat.com> <5178044B.5020708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5178044B.5020708@redhat.com> 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: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@gmail.com, aliguori@us.ibm.com, vilanova@ac.upc.edu, mdroth@linux.vnet.ibm.com On Wed, Apr 24, 2013 at 06:11:55PM +0200, Paolo Bonzini wrote: > Il 24/04/2013 18:08, Amos Kong ha scritto: > > diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py > > index 9e19920..e449a14 100644 > > --- a/scripts/qapi-types.py > > +++ b/scripts/qapi-types.py > > @@ -276,6 +276,7 @@ fdecl.write(mcgen(''' > > #include > > #include > > > > +struct strList; > > ''', > > guard=guardname(h_file))) > > > > diff --git a/scripts/qapi.py b/scripts/qapi.py > > index afc5f32..14f9f4d 100644 > > --- a/scripts/qapi.py > > +++ b/scripts/qapi.py > > @@ -166,11 +166,11 @@ def c_fun(name, protect=True): > > return c_var(name, protect).replace('.', '_') > > > > def c_list_type(name): > > - return '%sList' % name > > + return 'struct %sList' % name > > > > def type_name(name): > > if type(name) == list: > > - return c_list_type(name[0]) > > + return '%sList' % name[0] > > return name > > This second change is needed to generate the correct function names, > right? If so, Yes, otherwise, the visit function name will be "visit_type_struct nameList". > Reviewed-by: Paolo Bonzini > > Paolo Thanks -- Amos.