This is patches 10-19 of v2: https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg06079.html
Depends on Markus' qapi-next branch (which includes v3 of this series mapping to the first half of v2). Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-implicit-v4 and will soon be part of my branch at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi The big change here is a refactoring of how to visit implicit types: I bit the bullet, and exposed the types in qapi-types.h, along with visit_type_FOO_members() in qapi-visit.h. It made a lot of the earlier series pointless (I no longer needed patch 10, 11, 13, or 15), at the expense of a couple new patches. The generated code gets larger, but I reclaimed some of the growth in qapi-types.h by using the visit_type_FOO_members() functions in more places in qapi-commands.py and qapi-events.py. This series also rearranges some patches posted earlier, and squashed 17-18 as part of converting one more flat union. I suspect there may be some conversation on how best to detect implicit types (I hacked in "name[0] == ':'", which is not the prettiest), but am overall pleased with how this turned out in comparison to v2. backport-diff gets confused by a patch split and some renames: 001/10:[down] 'qapi: Assert in places where variants are not handled' 002/10:[0006] [FC] 'qapi: Fix command with named empty argument type' 003/10:[0016] [FC] 'qapi: Make c_type() more OO-like' 004/10:[down] 'qapi: Emit implicit structs in generated C' 005/10:[down] 'qapi: Utilize implicit struct visits' 006/10:[down] 'qapi-commands: Inline single-use helpers of gen_marshal()' 007/10:[0098] [FC] 'qapi: Don't special-case simple union wrappers' 008/10:[0038] [FC] 'qapi: Allow anonymous base for flat union' 009/10:[down] 'qapi: Use anonymous bases in QMP flat unions' 010/10:[----] [-C] 'qapi: Populate info['name'] for each entity' Eric Blake (10): qapi: Assert in places where variants are not handled qapi: Fix command with named empty argument type qapi: Make c_type() more OO-like qapi: Emit implicit structs in generated C qapi: Utilize implicit struct visits qapi-commands: Inline single-use helpers of gen_marshal() qapi: Don't special-case simple union wrappers qapi: Allow anonymous base for flat union qapi: Use anonymous bases in QMP flat unions qapi: Populate info['name'] for each entity scripts/qapi.py | 105 ++++++++++++++++++-------- scripts/qapi-commands.py | 117 +++++++++++------------------ scripts/qapi-event.py | 17 ++--- scripts/qapi-types.py | 27 ++++--- scripts/qapi-visit.py | 40 +++------- backends/baum.c | 2 +- backends/msmouse.c | 2 +- block/nbd.c | 6 +- block/qcow2.c | 6 +- block/vmdk.c | 8 +- blockdev.c | 24 +++--- hmp.c | 8 +- hw/char/escc.c | 2 +- hw/input/hid.c | 8 +- hw/input/ps2.c | 6 +- hw/input/virtio-input-hid.c | 8 +- hw/mem/pc-dimm.c | 2 +- net/dump.c | 2 +- net/hub.c | 2 +- net/l2tpv3.c | 2 +- net/net.c | 4 +- net/netmap.c | 2 +- net/slirp.c | 2 +- net/socket.c | 2 +- net/tap-win32.c | 2 +- net/tap.c | 4 +- net/vde.c | 2 +- net/vhost-user.c | 2 +- numa.c | 4 +- qemu-char.c | 82 ++++++++++---------- qemu-nbd.c | 6 +- replay/replay-input.c | 44 +++++------ spice-qemu-char.c | 14 ++-- tests/test-io-channel-socket.c | 40 +++++----- tests/test-qmp-commands.c | 7 +- tests/test-qmp-input-visitor.c | 25 +++--- tests/test-qmp-output-visitor.c | 24 +++--- tpm.c | 2 +- ui/console.c | 4 +- ui/input-keymap.c | 10 +-- ui/input-legacy.c | 8 +- ui/input.c | 34 ++++----- ui/vnc-auth-sasl.c | 3 +- ui/vnc.c | 29 +++---- util/qemu-sockets.c | 35 ++++----- docs/qapi-code-gen.txt | 30 ++++---- qapi-schema.json | 20 ++--- qapi/block-core.json | 98 +++++++++++------------- qapi/introspect.json | 12 +-- tests/qapi-schema/flat-union-bad-base.err | 2 +- tests/qapi-schema/flat-union-bad-base.json | 5 +- tests/qapi-schema/qapi-schema-test.json | 8 +- tests/qapi-schema/qapi-schema-test.out | 12 +-- 53 files changed, 476 insertions(+), 496 deletions(-) -- 2.5.0