From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDk1a-0004kq-Tg for qemu-devel@nongnu.org; Thu, 16 Jun 2016 23:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDk1W-0004pK-IL for qemu-devel@nongnu.org; Thu, 16 Jun 2016 23:00:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDk1W-0004pG-8b for qemu-devel@nongnu.org; Thu, 16 Jun 2016 23:00:46 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FD55C04B311 for ; Fri, 17 Jun 2016 03:00:45 +0000 (UTC) References: <1465526889-8339-1-git-send-email-eblake@redhat.com> <1465526889-8339-4-git-send-email-eblake@redhat.com> <87porhw3d5.fsf@dusky.pond.sub.org> <874m8tumm9.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <576367D0.2090504@redhat.com> Date: Thu, 16 Jun 2016 21:00:32 -0600 MIME-Version: 1.0 In-Reply-To: <874m8tumm9.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Q0NdP55f2rb9cEqQ8NxHCKMed6L8X1lDB" Subject: Re: [Qemu-devel] [PATCH 3/4] qobject: Parse non-finite numbers, as an extension List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Q0NdP55f2rb9cEqQ8NxHCKMed6L8X1lDB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/16/2016 10:25 AM, Markus Armbruster wrote: > I think this commit mixes up parsing of non-finite numbers, which we ma= y > or may not want, with general test improvements, which we'll want > regardless. Please split the patch. >=20 > On the parsing of non-finite numbers: the code looks good to me, but as= > long as we're not ready to extend QMP to include non-finite numbers bot= h > ways, I doubt we need to parse them. Even if we want to guarantee that we will never generate a non-finite number as the result of a QMP command, we DO have to worry about the 'id' field. With all this series applied: $ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio{"QMP": {"version": {"qemu": {"micro": 50, "minor": 6, "major": 2}, "package": " (v2.6.0-1151-g1bb9f5e)"}, "capabilities": []}} {'execute':'qmp_capabilities', 'id':[nan,inf,-Infinity]} {"return": {}, "id": ["nan", "inf", "-inf"]} and with just 1-3 applied: $ ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio{"QMP": {"version": {"qemu": {"micro": 50, "minor": 6, "major": 2}, "package": " (v2.6.0-1151-g1bb9f5e)"}, "capabilities": []}} {'execute':'qmp_capabilities', 'id':[nan,inf,-Infinity]} {"return": {}, "id": [nan, inf, -inf]} [okay, I cheated, as evidenced by the new git stuff appended in the version output being the same between the two lines, but you get the idea= ]. I'm comfortable with a compromise that asserts that QMP commands will never output a non-finite number anywhere that introspection lists 'number', but that QMP itself understands the extension of parsing a bare inf anywhere, and if a bare inf appears under 'id', then the replay of 'id' will also include a bare inf (if your JSON library allows you to send non-JSON, it should also allow you to parse non-JSON). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Q0NdP55f2rb9cEqQ8NxHCKMed6L8X1lDB 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/ iQEcBAEBCAAGBQJXY2fQAAoJEKeha0olJ0NquKsH/iM4lgV7G7FUHj6/tc8ol5bK SsIzJlfjmSAztwImVoZjxjOdFIW5BMObe9TunANagdNSkmbsFzbOyFP1uWBmg3o7 D0N5zx0CGPqAIxc9YVretg+GoYsOilfTCbO20y/D/hoesV0JFiK+NZcCI4hptfqe +g1tUMSXTzZAnvV2cl+Gh2/GyoA/vGpJHDkboe9DVFnUXMtVujLDbjI2Et830rR0 ZKkhbbn14SD1O7t9zjCKCgm81En435Rn3iQ6g+oWTg1wUZR85Co7H5QWKPSkJp2D uimTXs5OZcCFtR3LDGd/QQninrLgD4yQ+PtAirq/fn8XPxvZe4wY40nvHQIKfVI= =hWvi -----END PGP SIGNATURE----- --Q0NdP55f2rb9cEqQ8NxHCKMed6L8X1lDB--