unicorn/qemu/qapi
Eric Blake ae8d475ae0
qmp: Tighten output visitor rules
Tighten assertions in the QMP output visitor, so that:

- qmp_output_get_qobject() can only be called after pairing a
visit_end_* for every visit_start_* (rather than allowing it on
a partially built object)

- qmp_output_get_qobject() cannot be called unless at least one
visit_type_* or visit_start/visit_end pair has occurred since
creation/reset (the accidental return of NULL fixed by commit
ab8bf1d7 would have been much easier to diagnose)

- ensure that we are encountering the expected object or list
type, to provide protection against mismatched push(struct)/
pop(list) or push(list)/pop(struct), similar to the qmp-input
protection added in commit bdd8e6b5.

- ensure that except for the root, 'name' is non-null inside a
dict, and NULL inside a list (this may need changing later if
we add "name.0" support for better error messages for a list,
but for now it makes sure all users are at least consistent)

Backports commit 56a6f02b8ce1fe41a2a9077593e46eca7d98267d from qemu
2018-02-23 19:04:41 -05:00
..
common.json qapi: Add alias for ErrorClass 2018-02-19 20:38:51 -05:00
Makefile.objs
qapi-dealloc-visitor.c qapi: Add visit_type_null() visitor 2018-02-23 15:48:57 -05:00
qapi-visit-core.c qapi: Add visit_type_null() visitor 2018-02-23 15:48:57 -05:00
qmp-input-visitor.c qmp: Support explicit null during visits 2018-02-23 19:02:18 -05:00
qmp-output-visitor.c qmp: Tighten output visitor rules 2018-02-23 19:04:41 -05:00
string-input-visitor.c qapi: Guarantee NULL obj on input visitor callback error 2018-02-23 14:53:23 -05:00