[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 0/4] Guarantee valid JSON in QMP, even for nonfinite
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH 0/4] Guarantee valid JSON in QMP, even for nonfinite numbers |
Date: |
Thu, 9 Jun 2016 20:48:05 -0600 |
Flesh out an idea that came up during my JSON visitor series.
Semantic errors are nicer than lexical errors. While we generally
consider any non-finite number a bug in our code (that is, we
don't plan to expose them over QMP), at least we can guarantee
that even with a bug in our code we are still giving the user
valid JSON, similar to how we convert non-UTF-8 byte sequences
to use the replacement character for valid UTF-8 output.
I hit a couple of checkpatch false negatives in while writing this
series; one was easy to fix, but the other stumped me. It doesn't
help that checkpatch tweaks also trigger checkpatch warnings...
Eric Blake (4):
qobject: Correct JSON lexer grammar comments
checkpatch: There is no qemu_strtod()
qobject: Parse non-finite numbers, as an extension
qobject: Output valid JSON for non-finite numbers
qobject/json-lexer.c | 32 ++++++++++++++++++++-------
qobject/json-parser.c | 13 +++++++++--
qobject/qjson.c | 15 ++++++++++---
tests/check-qjson.c | 61 ++++++++++++++++++++++++++++++++++++++++++++-------
docs/qmp-spec.txt | 4 ++++
scripts/checkpatch.pl | 2 +-
6 files changed, 105 insertions(+), 22 deletions(-)
--
2.5.5
- [Qemu-devel] [PATCH 0/4] Guarantee valid JSON in QMP, even for nonfinite numbers,
Eric Blake <=
[Qemu-devel] [PATCH 4/4] qobject: Output valid JSON for non-finite numbers, Eric Blake, 2016/06/09
[Qemu-devel] [PATCH 2/4] checkpatch: There is no qemu_strtod(), Eric Blake, 2016/06/09