From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkZmw-0008Da-5T for qemu-devel@nongnu.org; Wed, 14 May 2014 10:04:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkZmr-0004pV-Mm for qemu-devel@nongnu.org; Wed, 14 May 2014 10:04:06 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:35597 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkZmr-0004pL-HD for qemu-devel@nongnu.org; Wed, 14 May 2014 10:04:01 -0400 Date: Wed, 14 May 2014 16:04:35 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140514140435.GA3531@irqsave.net> References: <1399650502-25530-1-git-send-email-benoit.canet@irqsave.net> <1399650502-25530-2-git-send-email-benoit.canet@irqsave.net> <537100CD.4020803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <537100CD.4020803@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V2] qapi: Let redundant includes be skipped excepted the first occurrence. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: =?iso-8859-1?Q?Beno=EEt?= Canet , armbru@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, vilanova@ac.upc.edu The Monday 12 May 2014 =E0 11:11:41 (-0600), Eric Blake wrote : > On 05/09/2014 09:48 AM, Beno=EEt Canet wrote: >=20 > Subject line has problems. 'excepted' is not a word, and you are alread= y > asked to avoid trailing '.'. I suggest a much simpler: >=20 > qapi: skip redundant includes >=20 > > The purpose of this change is to help create a json file containing > > common definitions; each bit of generated C code must be spitted >=20 > s/spitted/emitted/ >=20 > > only one time. > >=20 > > A second history global to all QAPISchema instances has been added > > to detect when a file is included more than one time and skip these > > includes. > > It does not act as a stack and the changes made to it by the > > __init__ function are propagated back to the caller so it's really > > a global state. > >=20 > > Signed-off-by: Benoit Canet > > --- >=20 > > index 0000000..573541a > > --- /dev/null > > +++ b/tests/qapi-schema/include-only-one-time.exit > > @@ -0,0 +1 @@ > > +0 > > diff --git a/tests/qapi-schema/include-only-one-time.json b/tests/qap= i-schema/include-only-one-time.json > > new file mode 100644 > > index 0000000..11772e3 > > --- /dev/null > > +++ b/tests/qapi-schema/include-only-one-time.json >=20 > Long name; you could get by with: >=20 > tests/qapi-schema/include-repetition.json >=20 > > @@ -0,0 +1,3 @@ > > +{ 'include': 'comments.json' } > > +{ 'include': 'sub-include-only-one-time.json' } >=20 > This naming doesn't preserve the 'include-' prefix used by all other > files related to include. Maybe: >=20 > { 'include': 'include-repetition-sub.json' } >=20 > --=20 > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >=20 Thanks for the review I'll iterate.