From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqNtE-0001r9-OK for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:43:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqNtB-0006Aj-9k for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:43:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqNtB-0006Ae-3m for qemu-devel@nongnu.org; Wed, 13 Apr 2016 12:43:37 -0400 References: <1460131992-32278-1-git-send-email-eblake@redhat.com> <1460131992-32278-7-git-send-email-eblake@redhat.com> <87twj5jxxf.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <570E7737.2040306@redhat.com> Date: Wed, 13 Apr 2016 10:43:35 -0600 MIME-Version: 1.0 In-Reply-To: <87twj5jxxf.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MAe3Ttm1CS0eJvuVIWLoWJKdv2dEXIt47" Subject: Re: [Qemu-devel] [PATCH v14 06/19] qmp-input: Don't consume input when checking has_member 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) --MAe3Ttm1CS0eJvuVIWLoWJKdv2dEXIt47 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/13/2016 10:06 AM, Markus Armbruster wrote: > Eric Blake writes: >=20 >> Commit e8316d7 mistakenly passed consume=3Dtrue >=20 > in qmp_input_optional(), right? yes >=20 >> when checking if >> an optional member was present, but the mistake was silently >> ignored since the code happily let us extract a member more than >> once. Tighten up the input visitor to ensure that a member is >> consumed exactly once. [1] by fixing qmp_input_optional() to pass consume=3Dfalse >> To keep the testsuite happy in the case >> of incomplete input, we have to check whether a member exists >> in the dictionary before trying to remove it. >=20 > Sure this is only for the testsuite's benefit? The testsuite was the only client that failed under the tighter semantics; but the better semantics allow later patches to further improve the code while guaranteeing that clients remain sane. >=20 > You fix commit e8316d7's incorrect consume=3Dtrue, don't you? Recommen= d > to mention that explicitly. I thought I did, but I can add wording [1] along those lines. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MAe3Ttm1CS0eJvuVIWLoWJKdv2dEXIt47 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/ iQEcBAEBCAAGBQJXDnc3AAoJEKeha0olJ0NqmdEIALDTJEn+7kXfG4XGNZ0+NekB HCZW6I5FH8bGToT4LcDpIwdF3KRIKQal8gtA+BPlxj8PK8E5FNYMaFebOSW3oNTV yky3Dhjnc8/hXcXtHi3ENU+hdbHshQsRohzutIWrWKizDxgd+igxn/bYQsCFHYIa JB3+i9XKPV/Imyh+QymkMcol42riug2hogJhw12oM40bI4EXGtO/O/r9a+JUCEt4 f5WcKq4K48T5CnUsSKNBcvwRbz/FnJUjx2UqTkvKICYLzyrm/TBvNQeCmHLoIsLM y4drMhxIY6T11/ogC3gxSkl1nWBSwYbHr3yEMv0p25Wiz1gHqpPiqdV7AQPRt2g= =JnXE -----END PGP SIGNATURE----- --MAe3Ttm1CS0eJvuVIWLoWJKdv2dEXIt47--