From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi2xq-00055E-Vl for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:13:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi2xn-0001uc-PW for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:13:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi2xn-0001uS-KV for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:13:39 -0400 References: <1443760312-656-1-git-send-email-eblake@redhat.com> <1443760312-656-6-git-send-email-eblake@redhat.com> <87eghdfy5m.fsf@blackfin.pond.sub.org> <560E8F86.7060305@redhat.com> <877fn5s184.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <560EAD31.8070100@redhat.com> Date: Fri, 2 Oct 2015 10:13:37 -0600 MIME-Version: 1.0 In-Reply-To: <877fn5s184.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="V83eDvevQ8FevMPh4OHJfajntGQskjKF0" Subject: Re: [Qemu-devel] [PATCH v6 05/12] qapi: Track location that created an implicit type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Michael Roth , marcandre.lureau@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --V83eDvevQ8FevMPh4OHJfajntGQskjKF0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/02/2015 10:07 AM, Markus Armbruster wrote: >>>> RFC: I used a class-level static flag to track whether we expected >>>> 'info is None' when creating a QAPISchemaEntity. This is gross, >>>> because the flag will only be set on the first QAPISchema() instance= >>>> (it works because none of our client scripts ever instantiate more >>>> than one schema). But the only other thing I could think of would >>>> be passing the QAPISchema instance into the constructor for each >>>> QAPISchemaEntity, which is a lot of churn. Any better ideas on how >>>> best to do the assertion, or should I just drop it? >>> >>> I'd check in QAPISchema._def_entity(). >> >> Ah, instead of an assert in QAPISchemaEntity.__init__() (which require= s >> a leaky abstraction), instead write the assert into QAPISchema (so the= >> flag can now be instance-local). Makes sense; I'll play with the idea= =2E >=20 > :) Oh, and this means accessing QAPISchemaEntity.info outside of the class, which absolutely kills off my idea of renaming it to _info for hiding purposes (so patch 12/12 is now officially gone). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --V83eDvevQ8FevMPh4OHJfajntGQskjKF0 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/ iQEcBAEBCAAGBQJWDq0xAAoJEKeha0olJ0NqwcoH/iCNPe3hvXvHUjMZSrl3bIk6 yppw+btENJgD/XEVBCn90lI5/cUMdWO+iCOJc70PuYfYcn+zPZ2wz1eBZStesfXl 9yteTwE8t2TmLsJ0HgboEIZhdz89aRx/tAnNBFvAVDDm5f7bH1SYiA28iQttgLUf COFWHygoVkL8Jk/tGLeDXF59NMNvb+Ua2xR2L6/M3wC32JmLAINwm8RSFWzzi1dr 3Y8d2Fk0hKGHiRuAsHRFtQ4E6fT3pV6M5lVzJ1Vn++oIlq3Hq3FsDHcf6XRiMR+2 8fSFnywrKcMZ74wybWmUh/vxdfPndKQEOD9pkK7yU7rMdLHY98PZ6VGeH+jiviQ= =N8S1 -----END PGP SIGNATURE----- --V83eDvevQ8FevMPh4OHJfajntGQskjKF0--