From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm0YQ-0000Ux-7s for qemu-devel@nongnu.org; Tue, 13 Oct 2015 10:27:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm0YM-0000hR-0q for qemu-devel@nongnu.org; Tue, 13 Oct 2015 10:27:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm0YL-0000gp-Qd for qemu-devel@nongnu.org; Tue, 13 Oct 2015 10:27:45 -0400 References: <1444710158-8723-1-git-send-email-eblake@redhat.com> <1444710158-8723-13-git-send-email-eblake@redhat.com> <87612b7ygb.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <561D14DA.70801@redhat.com> Date: Tue, 13 Oct 2015 08:27:38 -0600 MIME-Version: 1.0 In-Reply-To: <87612b7ygb.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pBblWLCfW88PMVSs4rLK8RKsOBmcifKCU" Subject: Re: [Qemu-devel] [PATCH v8 12/18] qapi: Track location that created an implicit type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pBblWLCfW88PMVSs4rLK8RKsOBmcifKCU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/13/2015 06:19 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> A future patch will move some error checking from the parser >> to the various QAPISchema*.check() methods, which run only >> after parsing completes. It will thus be possible to create >> a python instance representing an implicit QAPI type that >> parses fine but will fail validation during check(). Since >> all errors have to have an associated 'info' location, we >> need a location to be associated with those implicit types. >> The intuitive info to use is the location of the enclosing >> entity that caused the creation of the implicit type; similar >> to what was done for array types in an earlier patch. >> >> +++ b/scripts/qapi.py >> @@ -793,9 +793,9 @@ class QAPISchemaEntity(object): >> # For explicitly defined entities, info points to the (explic= it) >> # definition. For builtins (and their arrays), info is None.= >> # For other arrays, info points to an explicit place that use= s >> - # the array (there may be more than one such place). >> - # TODO For other implicitly defined entities, it should point= to >> - # a place that triggers implicit definition. >> + # the array (there may be more than one such place). For oth= er >> + # implicitly defined entities, it points to the place that >> + # triggered the implicit definition. >=20 > How does info for implicitly defined arrays differ from info for other > implicitly defined entities? I suspect it doesn't, and this comment > should become simpler: >=20 > # For explicitly defined entities, info points to the (explicit= ) > # definition. For builtins (and their arrays), info is None. > # For implicitly defined entities, info points to a place that > # triggered the implicit definition (there may be more than one= > # such place). >=20 Works for me. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pBblWLCfW88PMVSs4rLK8RKsOBmcifKCU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWHRTaAAoJEKeha0olJ0NqswgIAIKXTzVkjnk/2uu0fxI0tzX2 sWwFTP8wVIrRsU+xc1h3gASFPNwToeTcubg6LgN+A+hQjaTsTLTCv/a/KshS6HGs WtWHAuURxLF/LhOGPXrOrwgUM+jhSbcbOF9eW9akRJdrnOvqQRp7eRQpscokxX4B izCw5OI11jvKaeFOgmoGK6DLYWOW9pBGxVxcnOkxIghSR6uZcTpIa2pWxTJSg/0s pN5hrC8StL4eJLfwf7IlBh6ZYD4rb4VAFYDlDEVcHyP2L0RHYKa4ZGlehIuZhkmH AxjVnTWFJp90/fVFLPRI8T09EfSG23JCHL6d7NhAh1FLFMZmOWqxmqJQEBeZ2gw= =cxHj -----END PGP SIGNATURE----- --pBblWLCfW88PMVSs4rLK8RKsOBmcifKCU--