This is now 2.7 material (it is too invasive for hard freeze). Based on master, with no prerequisite patches.
Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv14e and will soon be part of my branch with the rest of the v5 series, at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi v13 was: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01224.html Only minor rebasing since then, plus one patch deferred from my previous series: 001/19:[down] 'qapi: Consolidate object visitors' 002/19:[----] [--] 'qapi-visit: Add visitor.type classification' 003/19:[----] [--] 'qapi: Guarantee NULL obj on input visitor callback error' 004/19:[----] [--] 'qmp: Drop dead command->type' 005/19:[----] [--] 'qmp-input: Clean up stack handling' 006/19:[----] [--] 'qmp-input: Don't consume input when checking has_member' 007/19:[----] [--] 'qmp-input: Refactor when list is advanced' 008/19:[----] [-C] 'qapi: Document visitor interfaces, add assertions' 009/19:[----] [--] 'tests: Add check-qnull' 010/19:[----] [--] 'qapi: Add visit_type_null() visitor' 011/19:[0001] [FC] 'qmp: Support explicit null during visits' 012/19:[----] [--] 'spapr_drc: Expose 'null' in qom-get when there is no fdt' 013/19:[----] [--] 'qmp: Tighten output visitor rules' 014/19:[0014] [FC] 'qapi: Split visit_end_struct() into pieces' 015/19:[----] [-C] 'qapi-commands: Wrap argument visit in visit_start_struct' 016/19:[----] [--] 'qom: Wrap prop visit in visit_start_struct' 017/19:[----] [--] 'qmp-input: Require struct push to visit members of top dict' 018/19:[----] [--] 'qapi: Simplify semantics of visit_next_list()' 019/19:[----] [--] 'qapi: Change visit_type_FOO() to no longer return partial objects' Eric Blake (19): qapi: Consolidate object visitors qapi-visit: Add visitor.type classification qapi: Guarantee NULL obj on input visitor callback error qmp: Drop dead command->type qmp-input: Clean up stack handling qmp-input: Don't consume input when checking has_member qmp-input: Refactor when list is advanced qapi: Document visitor interfaces, add assertions tests: Add check-qnull qapi: Add visit_type_null() visitor qmp: Support explicit null during visits spapr_drc: Expose 'null' in qom-get when there is no fdt qmp: Tighten output visitor rules qapi: Split visit_end_struct() into pieces qapi-commands: Wrap argument visit in visit_start_struct qom: Wrap prop visit in visit_start_struct qmp-input: Require struct push to visit members of top dict qapi: Simplify semantics of visit_next_list() qapi: Change visit_type_FOO() to no longer return partial objects include/qapi/visitor.h | 485 +++++++++++++++++++++++++++++++++-- include/qapi/visitor-impl.h | 80 ++++-- scripts/qapi.py | 10 +- scripts/qapi-commands.py | 10 + scripts/qapi-event.py | 5 +- scripts/qapi-introspect.py | 10 +- scripts/qapi-types.py | 13 +- scripts/qapi-visit.py | 68 ++--- include/qapi/dealloc-visitor.h | 4 + include/qapi/opts-visitor.h | 4 + include/qapi/qmp-output-visitor.h | 1 + include/qapi/qmp/dispatch.h | 6 - include/qapi/string-input-visitor.h | 5 + include/qapi/string-output-visitor.h | 5 + qapi/qapi-visit-core.c | 112 ++++++-- block/crypto.c | 14 +- hw/ppc/spapr_drc.c | 11 +- hw/virtio/virtio-balloon.c | 15 +- qapi/opts-visitor.c | 65 ++--- qapi/qapi-dealloc-visitor.c | 43 +--- qapi/qmp-dispatch.c | 18 +- qapi/qmp-input-visitor.c | 168 +++++++----- qapi/qmp-output-visitor.c | 72 +++--- qapi/qmp-registry.c | 1 - qapi/string-input-visitor.c | 39 +-- qapi/string-output-visitor.c | 43 ++-- qom/object.c | 5 +- qom/object_interfaces.c | 29 ++- tests/check-qnull.c | 69 +++++ tests/test-qmp-commands.c | 13 +- tests/test-qmp-input-strict.c | 19 +- tests/test-qmp-input-visitor.c | 27 +- tests/test-qmp-output-visitor.c | 17 +- docs/qapi-code-gen.txt | 33 ++- tests/.gitignore | 1 + tests/Makefile | 6 +- tests/qapi-schema/test-qapi.py | 10 +- 37 files changed, 1110 insertions(+), 426 deletions(-) create mode 100644 tests/check-qnull.c -- 2.5.5