mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-24 00:18:36 -07:00
The last case where qobject_from_json() & friends return null without
setting an error is empty or blank input. Callers:
* block.c's parse_json_protocol() reports "Could not parse the JSON
options". It's marked as a work-around, because it also covered
actual bugs, but they got fixed in the previous few commits.
* qobject_input_visitor_new_str() reports "JSON parse error". Also
marked as work-around. The recent fixes have made this unreachable,
because it currently gets called only for input starting with '{'.
* check-qjson.c's empty_input() and blank_input() demonstrate the
behavior.
* The other callers are not affected since they only pass input with
exactly one JSON value or, in the case of negative tests, one error.
Fail with "Expecting a JSON value" instead of returning null, and
simplify callers.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-48-armbru@redhat.com>
|
||
|---|---|---|
| .. | ||
| block-core.json | ||
| block.json | ||
| char.json | ||
| common.json | ||
| crypto.json | ||
| introspect.json | ||
| job.json | ||
| Makefile.objs | ||
| migration.json | ||
| misc.json | ||
| net.json | ||
| opts-visitor.c | ||
| qapi-clone-visitor.c | ||
| qapi-dealloc-visitor.c | ||
| qapi-schema.json | ||
| qapi-util.c | ||
| qapi-visit-core.c | ||
| qmp-dispatch.c | ||
| qmp-event.c | ||
| qmp-registry.c | ||
| qobject-input-visitor.c | ||
| qobject-output-visitor.c | ||
| rocker.json | ||
| run-state.json | ||
| sockets.json | ||
| string-input-visitor.c | ||
| string-output-visitor.c | ||
| tpm.json | ||
| trace-events | ||
| trace.json | ||
| transaction.json | ||
| ui.json | ||