Pending prerequisites: + Markus' "typedefs: Put them back into alphabetical order" https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04417.html + Markus' qapi-next branch http://repo.or.cz/qemu/armbru.git/shortlog/refs/heads/qapi-next + My v13 subset D patches: https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04732.html
Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv6e 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 v6 notes: My set of patches related to qapi visitors has grown, and it's time that I post it on list again. Of course, since this is all 2.6 material, and there's already lots of patches earlier in the queue, I may need a v7 to pick up rebase changes. A lot of the new patches in this series are based on fallout from implementing an early RFC posted against a v5 review: https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg06878.html Backport diff from v5: 001/23:[down] 'qapi: Make all visitors supply int64/uint64 callbacks' 002/23:[down] 'qapi: Require int64/uint64 implementation' 003/23:[down] 'qapi: Consolidate visitor integer callbacks' 004/23:[down] 'qapi: Don't cast Enum* to int*' 005/23:[----] [--] 'qmp: Fix reference-counting of qnull on empty output visit' 006/23:[----] [--] 'qapi: Don't abuse stack to track qmp-output root' 007/23:[0100] [FC] 'qapi: Document visitor interfaces' 008/23:[down] 'qapi: Drop unused error argument for list and implicit struct' 009/23:[down] 'hmp: Improve use of qapi visitor' 010/23:[down] 'vl: Improve use of qapi visitor' 011/23:[down] 'ppc: Improve use of qapi visitors' 012/23:[down] 'balloon: Improve use of qapi visitor' 013/23:[down] 'qapi: Add type.is_empty() helper' 014/23:[down] 'qapi: Fix command with named empty argument type' 015/23:[down] 'qapi: Improve generated event use of qapi visitor' 016/23:[down] 'qapi: Track all failures between visit_start/stop' 017/23:[down] 'qapi: Eliminate empty visit_type_FOO_fields' 018/23:[down] 'qapi: Canonicalize missing object to :empty' 019/23:[down] 'qapi-visit: Unify struct and union visit' 020/23:[0029] [FC] 'qapi: Rework deallocation of partial struct' 021/23:[down] 'qapi: Simplify extra member error reporting in input visitors' 022/23:[down] 'qapi: Split visit_end_struct() into pieces' 023/23:[0174] [FC] 'qapi: Change visit_type_FOO() to no longer return partial objects' Subset F (and more?) will come later. In v5: https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg05410.html I _did_ rearrange patches to try and group related features: 1-2: Groundwork cleanups 3-5: Add more test cases 6-16: Front-end cleanups 17-18: Introspection output cleanups 19-20: 'alternate' type cleanups 21-29: qapi visitor cleanups 30-45: qapi-ify netdev_add 46: add qapi shorthand for flat unions Lots of fixes based on additional testing, and rebased to track other changes that happened in the meantime. The series is huge; I can split off smaller portions as requested. In v4: https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02580.html add some more clean up patches rebase to Markus' recent work pull in part of Zoltán's work to make netdev_add a flat union, further enhancing it to be introspectible I might be able to rearrange some of these patches, or separate it into smaller independent series, if requested; but I'm posting now to get review started. In v3: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg02059.html redo cleanup of dealloc of partial struct add patches to make all visit_type_*() avoid leaks on failure add patches to allow boxed command arguments and events In v2: https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg00900.html rebase to Markus' v3 series rework how comments are emitted for fields inherited from base additional patches added for deleting colliding 'void *data' documentation updates to match code changes v1 was here: https://lists.gnu.org/archive/html/qemu-devel/2015-07/msg05266.html https://lists.gnu.org/archive/html/qemu-devel/2015-07/msg05325.html Eric Blake (23): qapi: Make all visitors supply int64/uint64 callbacks qapi: Require int64/uint64 implementation qapi: Consolidate visitor integer callbacks qapi: Don't cast Enum* to int* qmp: Fix reference-counting of qnull on empty output visit qapi: Don't abuse stack to track qmp-output root qapi: Document visitor interfaces qapi: Drop unused error argument for list and implicit struct hmp: Improve use of qapi visitor vl: Improve use of qapi visitor ppc: Improve use of qapi visitors balloon: Improve use of qapi visitor qapi: Add type.is_empty() helper qapi: Fix command with named empty argument type qapi: Improve generated event use of qapi visitor qapi: Track all failures between visit_start/stop qapi: Eliminate empty visit_type_FOO_fields qapi: Canonicalize missing object to :empty qapi-visit: Unify struct and union visit qapi: Rework deallocation of partial struct qapi: Simplify extra member error reporting in input visitors qapi: Split visit_end_struct() into pieces qapi: Change visit_type_FOO() to no longer return partial objects hmp.c | 22 ++- hw/ppc/spapr_drc.c | 16 ++- hw/virtio/virtio-balloon.c | 21 +-- include/qapi/visitor-impl.h | 71 +++++++--- include/qapi/visitor.h | 232 +++++++++++++++++++++++++++++--- qapi/opts-visitor.c | 43 +++--- qapi/qapi-dealloc-visitor.c | 59 +++----- qapi/qapi-visit-core.c | 196 +++++++++++---------------- qapi/qmp-input-visitor.c | 92 +++++++------ qapi/qmp-output-visitor.c | 94 +++++++------ qapi/string-input-visitor.c | 26 +++- qapi/string-output-visitor.c | 20 ++- qom/object.c | 5 +- scripts/qapi-commands.py | 7 +- scripts/qapi-event.py | 29 ++-- scripts/qapi-types.py | 6 +- scripts/qapi-visit.py | 225 +++++++++++++++---------------- scripts/qapi.py | 30 +++-- tests/qapi-schema/event-case.out | 2 +- tests/qapi-schema/flat-union-empty.out | 1 + tests/qapi-schema/ident-with-escape.out | 1 + tests/qapi-schema/indented-expr.out | 4 +- tests/qapi-schema/qapi-schema-test.json | 2 + tests/qapi-schema/qapi-schema-test.out | 47 ++++++- tests/qapi-schema/union-clash-data.out | 2 + tests/qapi-schema/union-empty.out | 1 + tests/test-qmp-commands.c | 18 ++- tests/test-qmp-input-strict.c | 19 ++- tests/test-qmp-input-visitor.c | 10 +- tests/test-qmp-output-visitor.c | 2 + vl.c | 29 ++-- 31 files changed, 797 insertions(+), 535 deletions(-) -- 2.4.3