From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3UOY-0004CX-4M for qemu-devel@nongnu.org; Thu, 19 May 2016 16:18:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3UOV-0003Zt-Vy for qemu-devel@nongnu.org; Thu, 19 May 2016 16:18:09 -0400 References: <1463632874-28559-1-git-send-email-eblake@redhat.com> <1463676743-22133-1-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <573E1F79.9020307@redhat.com> Date: Thu, 19 May 2016 14:18:01 -0600 MIME-Version: 1.0 In-Reply-To: <1463676743-22133-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8VRCuj89rjM7A8Kd0GR8XG9dhFq5n28wI" Subject: Re: [Qemu-devel] [PATCH v4 29/28] qapi: Add strict mode to JSON output visitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Michael Roth , "open list:Block layer core" , armbru@redhat.com, Luiz Capitulino , Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8VRCuj89rjM7A8Kd0GR8XG9dhFq5n28wI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/19/2016 10:52 AM, Eric Blake wrote: > Let the caller decide whether output must be strict JSON (and > raise an error on an attempt to output an encoding error or > non-finite number), vs. the status quo of relaxed (encoding > errors are rewritten to use substitute U+fffd characters, > and non-finite numbers are output). >=20 > Adjust the testsuite to cover this: check-qobject-json checks > relaxed mode (since qobject_to_json() is unchanged in behavior), > test-qmp-output-visitor checks that QObject doesn't care about > JSON restrictions, and test-json-output-visitor is now in > strict mode and flags the errors. >=20 > Signed-off-by: Eric Blake >=20 > +++ b/qobject/qobject-json.c > @@ -72,62 +72,81 @@ QObject *qobject_from_jsonf(const char *string, ...= ) > return obj; > } >=20 > +typedef struct ToJson { > +{ > + Visitor *v; Uggh, posted the wrong version. checkpatch complained the { was on the wrong line, so I added it in the right one and then pushed before re-saving after deleting the duplicate one. Actually, if this patch is worthwhile, I'm thinking that in v5, I'll minimize some of the churn and keep the ToJsonIterState struct that I removed in 26/28, even if it only has a single 'Visitor *v' member at that time, rather than completely removing it there to reinstate it here.= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8VRCuj89rjM7A8Kd0GR8XG9dhFq5n28wI 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/ iQEcBAEBCAAGBQJXPh95AAoJEKeha0olJ0NqFxQH/3HdFwOJC5X2qcBKv478BOJz LEuuQOfluI1o2SyhicyfvnvpFjB0JU7O9YiMUUaEn6ZBkJklcHCBDcn8vKFcZaK8 FVJDts4bHP+aZiVUcJBjr7fDrfRJLS7ozzrtiwmYnpkEsnhbY0Sin/GwReUv+yXR HB8cCH/iSYQNgngIUQOIVDqypN7CCfw8eV3VG3HD4MNRbRGJEELULmHR4yzs6kQ7 EmE6ndc+z2hvMBl1UDKwVPhJK9xNBXi12AHhMG2wKS1jL6/Td/e18jZXnCT5v95X bLXCAaosiAixrmgqTUAgZ1L/8UKOYzDjxwiTOctr6fnPSJleiKvyhS2f9jBwZOY= =+M7W -----END PGP SIGNATURE----- --8VRCuj89rjM7A8Kd0GR8XG9dhFq5n28wI--