From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
"open list:Block layer core" <qemu-block@nongnu.org>,
armbru@redhat.com, Luiz Capitulino <lcapitulino@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 29/28] qapi: Add strict mode to JSON output visitor
Date: Thu, 19 May 2016 14:18:01 -0600 [thread overview]
Message-ID: <573E1F79.9020307@redhat.com> (raw)
In-Reply-To: <1463676743-22133-1-git-send-email-eblake@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]
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).
>
> 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.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>
>
> +++ b/qobject/qobject-json.c
> @@ -72,62 +72,81 @@ QObject *qobject_from_jsonf(const char *string, ...)
> return obj;
> }
>
> +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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-05-19 20:18 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-19 4:40 [Qemu-devel] [PATCH v4 00/28] Add qapi-to-JSON and clone visitors Eric Blake
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 01/28] qapi: Rename (one) qjson.h to qobject-json.h Eric Blake
2016-06-01 15:09 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 02/28] qapi: Improve use of qmp/types.h Eric Blake
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 03/28] qemu-img: Don't leak errors when outputting JSON Eric Blake
2016-06-01 15:25 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 04/28] qapi: Add parameter to visit_end_* Eric Blake
2016-06-01 15:36 ` Markus Armbruster
2016-06-07 23:20 ` Eric Blake
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 05/28] qapi: Add new visit_free() function Eric Blake
2016-06-01 16:03 ` Markus Armbruster
2016-06-03 11:46 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 06/28] opts-visitor: Favor " Eric Blake
2016-06-01 16:06 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 07/28] string-input-visitor: " Eric Blake
2016-06-01 16:13 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 08/28] qmp-input-visitor: " Eric Blake
2016-06-01 16:19 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 09/28] string-output-visitor: " Eric Blake
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 10/28] qmp-output-visitor: " Eric Blake
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 11/28] tests: Factor out common code in qapi output tests Eric Blake
2016-06-01 16:33 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 12/28] qapi: Add new visit_complete() function Eric Blake
2016-06-01 17:02 ` Markus Armbruster
2016-05-19 4:40 ` [Qemu-devel] [PATCH v4 13/28] qapi: Add new clone visitor Eric Blake
2016-06-02 13:43 ` Markus Armbruster
2016-06-03 14:04 ` Markus Armbruster
2016-06-09 4:15 ` Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 14/28] sockets: Use new QAPI cloning Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 15/28] replay: " Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 16/28] qapi: Factor out JSON string escaping Eric Blake
2016-06-02 14:53 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting Eric Blake
2016-06-02 15:02 ` Markus Armbruster
2016-06-02 15:06 ` Eric Blake
2016-06-03 9:02 ` Markus Armbruster
2016-06-09 16:07 ` Eric Blake
2016-06-13 8:22 ` Markus Armbruster
2016-06-13 12:34 ` Eric Blake
2016-06-13 14:41 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 18/28] qapi: Add qstring_append_printf() Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 19/28] qapi: Use qstring_append_chr() where appropriate Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 20/28] qstring: Add qstring_consume_str() Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 21/28] qstring: Add qstring_wrap_str() Eric Blake
2016-06-02 15:21 ` Markus Armbruster
2016-06-09 16:31 ` Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 22/28] qobject: Consolidate qobject_to_json() calls Eric Blake
2016-06-02 15:32 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 23/28] tests: Test qobject_to_json() pretty formatting Eric Blake
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 24/28] qapi: Add JSON output visitor Eric Blake
2016-06-03 7:39 ` Markus Armbruster
2016-06-03 12:53 ` Eric Blake
2016-06-03 14:09 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 25/28] qapi: Support pretty printing in " Eric Blake
2016-06-03 7:56 ` Markus Armbruster
2016-06-03 12:55 ` Eric Blake
2016-06-03 14:08 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 26/28] qobject: Implement qobject_to_json() atop JSON visitor Eric Blake
2016-06-03 8:25 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 27/28] qapi: Add 'any' support to JSON output Eric Blake
2016-06-03 8:29 ` Markus Armbruster
2016-05-19 4:41 ` [Qemu-devel] [PATCH v4 28/28] qemu-img: Use new JSON output formatter Eric Blake
2016-05-19 14:58 ` [Qemu-devel] [PATCH v4 00/28] Add qapi-to-JSON and clone visitors Eric Blake
2016-05-19 16:52 ` [Qemu-devel] [PATCH v4 29/28] qapi: Add strict mode to JSON output visitor Eric Blake
2016-05-19 20:18 ` Eric Blake [this message]
2016-06-03 8:36 ` Markus Armbruster
2016-06-03 9:21 ` Markus Armbruster
2016-05-19 17:05 ` [Qemu-devel] [PATCH v4 00/28] Add qapi-to-JSON and clone visitors Markus Armbruster
2016-06-03 12:09 ` Markus Armbruster
2016-06-09 16:16 ` Eric Blake
2016-06-13 8:26 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=573E1F79.9020307@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).