From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCR4t-0004dY-Jw for qemu-devel@nongnu.org; Mon, 13 Jun 2016 08:34:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCR4o-0000L2-9L for qemu-devel@nongnu.org; Mon, 13 Jun 2016 08:34:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCR4o-0000Kp-14 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 08:34:46 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 8ED0EC057EC7 for ; Mon, 13 Jun 2016 12:34:45 +0000 (UTC) References: <1463632874-28559-1-git-send-email-eblake@redhat.com> <1463632874-28559-18-git-send-email-eblake@redhat.com> <8737oveirs.fsf@dusky.pond.sub.org> <57504B76.7040309@redhat.com> <87twha3as9.fsf@dusky.pond.sub.org> <57599424.7080308@redhat.com> <87vb1dqz01.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: <575EA864.4040406@redhat.com> Date: Mon, 13 Jun 2016 06:34:44 -0600 MIME-Version: 1.0 In-Reply-To: <87vb1dqz01.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="32pDWQqwbkxThtGDfGxrpLAXMJVXoR6qk" Subject: Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting 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) --32pDWQqwbkxThtGDfGxrpLAXMJVXoR6qk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/13/2016 02:22 AM, Markus Armbruster wrote: >> I may still try to tackle fixing the QMP parser to accept NaN and >> infinity on input (since it's hand-written, we at least have control >> over that) >=20 > Making json-lexer.c recognize infinities and NaNs in strtod() syntax > shouldn't be hard. I'd omit nan(n-char-sequence-opt), because its > semantics are implementation defined. I'd also omit all spellings othe= r > than inf and nan. That leaves inf, +inf, -inf, nan, +nan, -nan. +inf and +nan weren't worth it (JSON doesn't accept +0 either), but '-inf' and '-nan' were easy. In fact, '-infinity' was easy too - see the posted patches: https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg02652.html and you are right that it was not worth 'nan(n-char-seq)'. >=20 >> - it will certainly be easier than getting libvirt to parse= >> non-finite numbers (libvirt uses libyajl, and my emails to the yajl >> mailing list have gone unanswered, making me think the project is not >> very vibrant and thus not very patchable). >=20 > Nobody likes to carry downstream patches, but an unresponsive upstream > may leave you no choice. Another (possibly-ugly) option that I thought of over the weekend: We have 'qmp_capabilities' for handshakes between client and server. The server could advertise a new capability 'nonfinite' in its initial greeting, and if the client replies with the same capability, then the server knows that the client is prepared to accept bareword non-finite numbers. A client that doesn't see the server advertise anything has no guarantees, and a server that knows the capability but doesn't see the client request the capability should avoid sending bareword non-finite. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --32pDWQqwbkxThtGDfGxrpLAXMJVXoR6qk 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/ iQEcBAEBCAAGBQJXXqhkAAoJEKeha0olJ0Nqd5AH/0ymTFd345usM4i6eTsT1vPi +6UPMejq9+Q8m6fFEl8kkHc4gWQ9l8FNwH09t8D6Q25XdCy/h6iPodwZVBkqNl81 v0zAtqNM2/XMcjW2o4wlcEftDGS15PY8WTTkkTF+oegvR+9V41K5eEOAbyY6DwUf JB08hrl49x00qXTMjIIqoTnclyrZEBDtTn8vAHtx6VNRezDPMTocnA7KXvpi2tNz LomZM1WuXEQj7qNEY+Ggy0ulVxtZCUJsP8zdP5Sa+P44Ix+5xYcrhw56MGfO+Xot s/IAk+G4nrhORYwy9Dsj962fzZrN3I+LSjsjl9iGvGNYGcieFB1Z1mGJ+TO+lsg= =4y08 -----END PGP SIGNATURE----- --32pDWQqwbkxThtGDfGxrpLAXMJVXoR6qk--