From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjtlY-0008Vm-N7 for qemu-devel@nongnu.org; Mon, 12 May 2014 13:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjtlT-0001G7-EX for qemu-devel@nongnu.org; Mon, 12 May 2014 13:11:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjtlT-0001Fv-7g for qemu-devel@nongnu.org; Mon, 12 May 2014 13:11:47 -0400 Message-ID: <537100CD.4020803@redhat.com> Date: Mon, 12 May 2014 11:11:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1399650502-25530-1-git-send-email-benoit.canet@irqsave.net> <1399650502-25530-2-git-send-email-benoit.canet@irqsave.net> In-Reply-To: <1399650502-25530-2-git-send-email-benoit.canet@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sl8vJCEaQWWcthhs0u2E0uk2nK8HGwlN2" 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: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org Cc: armbru@redhat.com, Benoit Canet , vilanova@ac.upc.edu, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sl8vJCEaQWWcthhs0u2E0uk2nK8HGwlN2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/09/2014 09:48 AM, Beno=C3=AEt Canet wrote: Subject line has problems. 'excepted' is not a word, and you are already asked to avoid trailing '.'. I suggest a much simpler: qapi: skip redundant includes > The purpose of this change is to help create a json file containing > common definitions; each bit of generated C code must be spitted s/spitted/emitted/ > 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 > --- > 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/qapi-= schema/include-only-one-time.json > new file mode 100644 > index 0000000..11772e3 > --- /dev/null > +++ b/tests/qapi-schema/include-only-one-time.json Long name; you could get by with: tests/qapi-schema/include-repetition.json > @@ -0,0 +1,3 @@ > +{ 'include': 'comments.json' } > +{ 'include': 'sub-include-only-one-time.json' } This naming doesn't preserve the 'include-' prefix used by all other files related to include. Maybe: { 'include': 'include-repetition-sub.json' } --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --sl8vJCEaQWWcthhs0u2E0uk2nK8HGwlN2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTcQDNAAoJEKeha0olJ0NqZnUH/iV5TMHgLQ8N7N12PFx+hhdY ege9X1L4Apo1/wElWxtJMKRk01IGsG3hXN0bJyykizsiuri4XE4VuMfNanDd1WZg uHPEMQxK5SgwBeObVO5SJUewLYaR/jNx/VyE3Byo5/ONuIM4pgJU6CIqmJHaDZTZ Tf4I2xIJLlgZFMAM5W4uV+NFYTE3p4mQQUl71idy/J2vnKV+le1WuMHWM0kezdAM 9NTw6owbo3eij/MtFLkgo7ZCo3F4djINj226xm8fYjLm/83ad2xb5yBa6h3DoJEa zb+S9YJrtfMOlDKUl3/VObS3pK8tQhTk/5PByhQ34OQsCDR57wWJF2JDVFnVJo0= =xZdw -----END PGP SIGNATURE----- --sl8vJCEaQWWcthhs0u2E0uk2nK8HGwlN2--