Skip to content

qapi implicit types (continuing the qapi cleanup theme)

Eric Blake qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17chardev: Properly initialize ChardevCommon componentsinclude/sysemu/char.h qemu-char.c spice-qemu-char.c +1 more+30 -142 replies
2/17chardev: Shorten references into ChardevBackendqemu-char.c+66 -561 reply
3/17util: Shorten references into SocketAddressblock/nbd.c qemu-char.c qemu-nbd.c +3 more+81 -611 reply
4/17ui: Shorten references into InputEventhw/char/escc.c hw/input/hid.c hw/input/ps2.c +4 more+130 -891 reply
5/17qapi: Avoid use of 'data' member of qapi unionsblockdev.c ui/input.c+18 -151 reply
6/17chardev: Drop useless ChardevDummy typebackends/baum.c backends/msmouse.c qapi-schema.json +1 more+11 -141 reply
7/17qapi: Drop useless 'data' member of unionsscripts/qapi-types.py tests/Makefile tests/qapi-schema/qapi-schema-test.json +5 more+3 -301 reply
8/17qapi-visit: Factor out gen_visit_fields_call()scripts/qapi-visit.py+26 -220 replies
9/17qapi: Add type.is_empty() helperscripts/qapi-event.py scripts/qapi-types.py scripts/qapi.py+10 -40 replies
10/17qapi: Fix command with named empty argument typescripts/qapi-commands.py tests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out +1 more+12 -30 replies
11/17qapi-visit: Simplify visit of empty branch in unionscripts/qapi-visit.py+3 -10 replies
12/17qapi: Don't special-case simple union wrappersbackends/baum.c backends/msmouse.c block/nbd.c +38 more+262 -2571 reply
13/17qapi-visit: Move error check into gen_visit_fields_call()scripts/qapi-visit.py+4 -40 replies
14/17qapi: Allow anonymous base for flat uniondocs/qapi-code-gen.txt scripts/qapi-types.py scripts/qapi-visit.py +5 more+41 -380 replies
15/17qapi: Use anonymous base in SchemaInfoqapi/introspect.json+1 -110 replies
16/17qapi: Use anonymous base in CpuInfoqapi-schema.json scripts/qapi.py+7 -150 replies
17/17qapi: Make c_type() more OO-likescripts/qapi-types.py scripts/qapi.py+30 -100 replies

Reviews trailers per patch

9 of 17 patches have a Reviewed-by or Acked-by.

PatchMarc-André LureauDaniel P. Berrange
1/17R-b
2/17R-b
3/17R-b
4/17R-b
5/17R-b
6/17R-b
7/17R-b
8/17
9/17
10/17R-b
11/17
12/17R-b
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/17] qapi implicit types (continuing the qapi cleanup theme)

I don't know what letter and or number to assign this batch, so I'll just call it v1 of 'qapi-implicit' :) It does, however, incorporate reviews on several patches that were in subset E v9 [1], and some that were posted (but not yet reviewed) in subset F v6 [2]; the remaining patches are new but provide the promised work at cleaning up the generated code for simple unions, so that their implicit wrapper type is now unboxed without any special-case handling.

1-7: general cleanups, including a bug fix in patch 1 8: add the framework for doing inline visits of implicit types 9-11: add is_empty() helper, including a bug fix in patch 10 12-13: use the framework for simple unions
14: use the framework for anonymous bases of flat unions 15-17: tail-end cleanups

[1] https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg03504.html
[2] https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg04389.html

Based on current qemu.git master.

Also available as a tag at this location:
git fetch git://repo.or.cz/qemu/ericb.git qapi-implicitv1

and will soon be part of my branch at:
http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi

Backport diff based on patches that were previously posted:

001/17:[down] 'chardev: Properly initialize ChardevCommon components' 002/17:[down] 'chardev: Shorten references into ChardevBackend' 003/17:[down] 'util: Shorten references into SocketAddress' 004/17:[down] 'ui: Shorten references into InputEvent' 005/17:[----] [--] 'qapi: Avoid use of 'data' member of qapi unions' 006/17:[down] 'chardev: Drop useless ChardevDummy type' 007/17:[0002] [FC] 'qapi: Drop useless 'data' member of unions' 008/17:[down] 'qapi-visit: Factor out gen_visit_fields_call()' 009/17:[0003] [FC] 'qapi: Add type.is_empty() helper' 010/17:[----] [--] 'qapi: Fix command with named empty argument type' 011/17:[down] 'qapi-visit: Simplify visit of empty branch in union' 012/17:[down] 'qapi: Don't special-case simple union wrappers' 013/17:[down] 'qapi-visit: Move error check into gen_visit_fields_call()' 014/17:[0052] [FC] 'qapi: Allow anonymous base for flat union' 015/17:[----] [--] 'qapi: Use anonymous base in SchemaInfo' 016/17:[----] [--] 'qapi: Use anonymous base in CpuInfo' 017/17:[down] 'qapi: Make c_type() more OO-like'

Remaining qapi cleanups that are still on my queue, and have had patches posted to list:
- visitor cleanup: add documentation, optimize list visits, add visit_type_null(), prevent leaked memory after visit_type_FOO (reviewed as tail of subset E v9) [3]
- add a JSON output visitor (unreviewed at v2) [4]
- support boxed parameters for events and commands, use it to introspect netdev_add (unreviewed subset F, at v6) [5]

[3] https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg03504.html
[4] https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg03929.html
[5] https://lists.gnu.org/archive/html/qemu-devel/2015-12/msg04389.html

We'll see how much of that actually makes it in by 2.6 soft freeze.

Eric Blake (17):
chardev: Properly initialize ChardevCommon components
chardev: Shorten references into ChardevBackend
util: Shorten references into SocketAddress
ui: Shorten references into InputEvent
qapi: Avoid use of 'data' member of qapi unions
chardev: Drop useless ChardevDummy type
qapi: Drop useless 'data' member of unions
qapi-visit: Factor out gen_visit_fields_call()
qapi: Add type.is_empty() helper
qapi: Fix command with named empty argument type
qapi-visit: Simplify visit of empty branch in union
qapi: Don't special-case simple union wrappers
qapi-visit: Move error check into gen_visit_fields_call()
qapi: Allow anonymous base for flat union
qapi: Use anonymous base in SchemaInfo
qapi: Use anonymous base in CpuInfo
qapi: Make c_type() more OO-like

 scripts/qapi.py                            |  66 ++++++---
 scripts/qapi-commands.py                   |   6 +-
 scripts/qapi-event.py                      |   7 +-
 scripts/qapi-types.py                      |  45 +++---
 scripts/qapi-visit.py                      |  55 +++----
 include/sysemu/char.h                      |  10 ++
 backends/baum.c                            |   2 +-
 backends/msmouse.c                         |   2 +-
 block/nbd.c                                |  16 ++-
 block/qcow2.c                              |   6 +-
 block/vmdk.c                               |   8 +-
 blockdev.c                                 |  49 ++++---
 hmp.c                                      |   8 +-
 hw/char/escc.c                             |  12 +-
 hw/input/hid.c                             |  36 +++--
 hw/input/ps2.c                             |  27 ++--
 hw/input/virtio-input-hid.c                |  33 +++--
 hw/mem/pc-dimm.c                           |   4 +-
 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.c                                  |   4 +-
 net/vhost-user.c                           |   2 +-
 numa.c                                     |   4 +-
 qemu-char.c                                | 223 ++++++++++++++++-------------
 qemu-nbd.c                                 |  13 +-
 replay/replay-input.c                      |  63 ++++----
 spice-qemu-char.c                          |  22 +--
 tests/test-io-channel-socket.c             |  58 ++++----
 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                               |  22 +--
 ui/input-keymap.c                          |  10 +-
 ui/input-legacy.c                          |  26 ++--
 ui/input.c                                 |  72 +++++-----
 ui/vnc-auth-sasl.c                         |   3 +-
 ui/vnc.c                                   |  62 ++++----
 util/qemu-sockets.c                        |  44 +++---
 docs/qapi-code-gen.txt                     |  28 ++--
 qapi-schema.json                           |  35 ++---
 qapi/introspect.json                       |  12 +-
 tests/Makefile                             |   1 -
 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    |  10 +-
 tests/qapi-schema/qapi-schema-test.out     |  15 +-
 tests/qapi-schema/union-clash-data.err     |   0
 tests/qapi-schema/union-clash-data.exit    |   1 -
 tests/qapi-schema/union-clash-data.json    |   7 -
 tests/qapi-schema/union-clash-data.out     |   9 --
 56 files changed, 655 insertions(+), 564 deletions(-)
 delete mode 100644 tests/qapi-schema/union-clash-data.err
 delete mode 100644 tests/qapi-schema/union-clash-data.exit
 delete mode 100644 tests/qapi-schema/union-clash-data.json
 delete mode 100644 tests/qapi-schema/union-clash-data.out
Signature · 1 line
2.5.0