Skip to content

post-introspection cleanups, subset A

Eric Blake qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest18 patches 15 repliesIn review
  2. v616 patches 22 repliesSuperseded
  3. v546 patches 53 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v4 RFC29 patches10 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18qapi: Sort qapi-schema teststests/Makefile+114 -460 replies
2/18qapi: Improve 'include' error messagescripts/qapi.py tests/qapi-schema/include-non-file.err tests/qapi-schema/include-non-file.json+3 -40 replies
3/18qapi: Invoke exception superclass initializerscripts/qapi.py+2 -00 replies
4/18qapi: Clean up qapi.py per pep8scripts/ordereddict.py scripts/qapi.py+106 -580 replies
5/18qapi: Test for various name collisionstests/Makefile tests/qapi-schema/alternate-clash.err tests/qapi-schema/alternate-clash.json +47 more+190 -159 replies
6/18qapi: Avoid assertion failure on union 'type' collisionscripts/qapi.py tests/qapi-schema/flat-union-clash-type.err tests/qapi-schema/flat-union-clash-type.json +2 more+16 -421 reply
7/18qapi: Add tests for empty unionstests/Makefile tests/qapi-schema/alternate-empty.err tests/qapi-schema/alternate-empty.exit +12 more+30 -20 replies
8/18qapi: Test use of 'number' within alternatestests/qapi-schema/qapi-schema-test.json tests/qapi-schema/qapi-schema-test.out tests/test-qmp-input-visitor.c+158 -32 replies
9/18qapi: Reuse code for flat union base validationscripts/qapi.py tests/qapi-schema/flat-union-bad-base.err tests/qapi-schema/flat-union-base-any.err +6 more+14 -150 replies
10/18qapi: Consistent generated code: prefer error 'err'docs/qapi-code-gen.txt scripts/qapi-commands.py scripts/qapi-event.py+34 -340 replies
11/18qapi: Consistent generated code: prefer visitor 'v'docs/qapi-code-gen.txt qom/object.c qom/qom-qobject.c +3 more+109 -1090 replies
12/18qapi: Consistent generated code: prefer common labelsscripts/qapi-event.py scripts/qapi-visit.py+6 -60 replies
13/18qapi: Consistent generated code: prefer common indentationscripts/qapi-visit.py+27 -260 replies
14/18qapi: Consistent generated code: minimize push_indent() usagescripts/qapi-commands.py scripts/qapi-visit.py+33 -450 replies
15/18qapi: Share gen_err_check()scripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-visit.py +1 more+20 -322 replies
16/18qapi: Share gen_visit_fields()scripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-visit.py +1 more+46 -770 replies
17/18qapi: Simplify gen_visit_fields() error handlingscripts/qapi-commands.py scripts/qapi.py+11 -161 reply
18/18qapi: Use gen_err_check() in more placesscripts/qapi-commands.py scripts/qapi-event.py scripts/qapi-visit.py+41 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.

Read the v7 thread

Cover letter [Qemu-devel] [PATCH v7 00/18] post-introspection cleanups, subset A

Patch 17 is marked RFC because it has a prerequisite:
https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01277.html
Patch 18 is marked RFC because it is probably worth discarding. Otherwise, this series addresses the review comments on v6.

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

and I plan forcefully update my branch with the rest of the v5 series at some point, located at:
http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi

v7 notes:
The most churn compared to the last spin was questions over commit messages and testsuite comments in 5/16, and to an over-reaching commit 15/16 (now split, with patch 18 as the half of the split that we will probably drop). Patch 12 no longer tries gnu-style label indentation. Other patches had minor tweaks to commit messages or fixing rebase issues.

More details in per-patch messages; and here's the backport diff:
001/18:[----] [--] 'qapi: Sort qapi-schema tests'
002/18:[----] [--] 'qapi: Improve 'include' error message' 003/18:[----] [--] 'qapi: Invoke exception superclass initializer' 004/18:[0004] [FC] 'qapi: Clean up qapi.py per pep8'
005/18:[0090] [FC] 'qapi: Test for various name collisions' 006/18:[0018] [FC] 'qapi: Avoid assertion failure on union 'type' collision' 007/18:[----] [-C] 'qapi: Add tests for empty unions'
008/18:[----] [--] 'qapi: Test use of 'number' within alternates' 009/18:[0008] [FC] 'qapi: Reuse code for flat union base validation' 010/18:[----] [--] 'qapi: Consistent generated code: prefer error 'err'' 011/18:[----] [--] 'qapi: Consistent generated code: prefer visitor 'v'' 012/18:[0026] [FC] 'qapi: Consistent generated code: prefer common labels' 013/18:[0004] [FC] 'qapi: Consistent generated code: prefer common indentation' 014/18:[----] [-C] 'qapi: Consistent generated code: minimize push_indent() usage' 015/18:[0074] [FC] 'qapi: Share gen_err_check()'
016/18:[----] [-C] 'qapi: Share gen_visit_fields()'
017/18:[down] 'qapi: Simplify gen_visit_fields() error handling' 018/18:[down] 'RFC: qapi: Use gen_err_check() in more places'

In v6:
https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg07208.html
This is patches 1-6 and 8-10 of my v5 series; patch 7 had enough comments that I'm still reworking it and sank it later into that series. It is 16 patches because I split several patches, and added a couple more, in part because review on v5 let me discover a place where we can crash the qapi code generator with an assert.

Addresses lots of review comments, mainly from Markus; see individual patches for more details.

Subset B (and more?) will come later as Markus continues to review either the rest of my v5 series, or as I get a chance to post a rebased version of them.

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 (18):
qapi: Sort qapi-schema tests
qapi: Improve 'include' error message
qapi: Invoke exception superclass initializer
qapi: Clean up qapi.py per pep8
qapi: Test for various name collisions
qapi: Avoid assertion failure on union 'type' collision
qapi: Add tests for empty unions
qapi: Test use of 'number' within alternates
qapi: Reuse code for flat union base validation
qapi: Consistent generated code: prefer error 'err'
qapi: Consistent generated code: prefer visitor 'v'
qapi: Consistent generated code: prefer common labels
qapi: Consistent generated code: prefer common indentation
qapi: Consistent generated code: minimize push_indent() usage
qapi: Share gen_err_check()
qapi: Share gen_visit_fields()
qapi: Simplify gen_visit_fields() error handling
qapi: Use gen_err_check() in more places

 docs/qapi-code-gen.txt                             | 102 ++++-----
 qom/object.c                                       |  18 +-
 qom/qom-qobject.c                                  |  18 +-
 scripts/ordereddict.py                             |   3 +-
 scripts/qapi-commands.py                           | 120 ++++-------
 scripts/qapi-event.py                              |  54 +----
 scripts/qapi-types.py                              |   8 +-
 scripts/qapi-visit.py                              | 174 +++++++--------
 scripts/qapi.py                                    | 237 +++++++++++++++------
 tests/Makefile                                     | 171 +++++++++++----
 tests/qapi-schema/alternate-clash.err              |   2 +-
 tests/qapi-schema/alternate-clash.json             |   9 +-
 ...-union-branch-clash.out => alternate-empty.err} |   0
 tests/qapi-schema/alternate-empty.exit             |   1 +
 tests/qapi-schema/alternate-empty.json             |   2 +
 tests/qapi-schema/alternate-empty.out              |   4 +
 tests/qapi-schema/alternate-nested.json            |   2 +-
 tests/qapi-schema/alternate-unknown.json           |   2 +-
 tests/qapi-schema/args-name-clash.err              |   0
 tests/qapi-schema/args-name-clash.exit             |   1 +
 tests/qapi-schema/args-name-clash.json             |   5 +
 tests/qapi-schema/args-name-clash.out              |   6 +
 tests/qapi-schema/duplicate-key.err                |   2 +-
 tests/qapi-schema/duplicate-key.json               |   1 +
 tests/qapi-schema/flat-union-bad-base.err          |   2 +-
 tests/qapi-schema/flat-union-base-any.err          |   2 +-
 tests/qapi-schema/flat-union-base-union.err        |   2 +-
 tests/qapi-schema/flat-union-base-union.json       |   5 +-
 tests/qapi-schema/flat-union-branch-clash.err      |   1 -
 tests/qapi-schema/flat-union-clash-branch.err      |   0
 tests/qapi-schema/flat-union-clash-branch.exit     |   1 +
 tests/qapi-schema/flat-union-clash-branch.json     |  18 ++
 tests/qapi-schema/flat-union-clash-branch.out      |  14 ++
 tests/qapi-schema/flat-union-clash-member.err      |   1 +
 ...nch-clash.exit => flat-union-clash-member.exit} |   0
 ...nch-clash.json => flat-union-clash-member.json} |   2 +-
 tests/qapi-schema/flat-union-clash-member.out      |   0
 tests/qapi-schema/flat-union-clash-type.err        |   1 +
 tests/qapi-schema/flat-union-clash-type.exit       |   1 +
 tests/qapi-schema/flat-union-clash-type.json       |  14 ++
 tests/qapi-schema/flat-union-clash-type.out        |   0
 tests/qapi-schema/flat-union-cycle.err             |   1 +
 tests/qapi-schema/flat-union-cycle.exit            |   1 +
 tests/qapi-schema/flat-union-cycle.json            |   8 +
 tests/qapi-schema/flat-union-cycle.out             |   0
 tests/qapi-schema/flat-union-empty.err             |   0
 tests/qapi-schema/flat-union-empty.exit            |   1 +
 tests/qapi-schema/flat-union-empty.json            |   4 +
 tests/qapi-schema/flat-union-empty.out             |   7 +
 tests/qapi-schema/flat-union-inline.err            |   2 +-
 tests/qapi-schema/flat-union-inline.json           |   4 +-
 tests/qapi-schema/flat-union-no-base.err           |   2 +-
 tests/qapi-schema/include-non-file.err             |   2 +-
 tests/qapi-schema/include-non-file.json            |   2 +-
 tests/qapi-schema/qapi-schema-test.json            |  15 +-
 tests/qapi-schema/qapi-schema-test.out             |  26 +++
 tests/qapi-schema/struct-base-clash-base.err       |   0
 tests/qapi-schema/struct-base-clash-base.exit      |   1 +
 tests/qapi-schema/struct-base-clash-base.json      |   9 +
 tests/qapi-schema/struct-base-clash-base.out       |   5 +
 tests/qapi-schema/struct-base-clash-deep.err       |   2 +-
 tests/qapi-schema/struct-base-clash-deep.json      |   5 +-
 tests/qapi-schema/struct-base-clash.err            |   2 +-
 tests/qapi-schema/struct-base-clash.json           |   3 +-
 tests/qapi-schema/union-clash-branches.err         |   1 +
 tests/qapi-schema/union-clash-branches.exit        |   1 +
 tests/qapi-schema/union-clash-branches.json        |   5 +
 tests/qapi-schema/union-clash-branches.out         |   0
 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             |   6 +
 tests/qapi-schema/union-clash-type.err             |   1 +
 tests/qapi-schema/union-clash-type.exit            |   1 +
 tests/qapi-schema/union-clash-type.json            |   8 +
 tests/qapi-schema/union-clash-type.out             |   0
 tests/qapi-schema/union-empty.err                  |   0
 tests/qapi-schema/union-empty.exit                 |   1 +
 tests/qapi-schema/union-empty.json                 |   2 +
 tests/qapi-schema/union-empty.out                  |   3 +
 tests/qapi-schema/union-invalid-base.err           |   2 +-
 tests/test-qmp-input-visitor.c                     | 129 ++++++++++-
 82 files changed, 837 insertions(+), 439 deletions(-)
 rename tests/qapi-schema/{flat-union-branch-clash.out => alternate-empty.err} (100%)
 create mode 100644 tests/qapi-schema/alternate-empty.exit
 create mode 100644 tests/qapi-schema/alternate-empty.json
 create mode 100644 tests/qapi-schema/alternate-empty.out
 create mode 100644 tests/qapi-schema/args-name-clash.err
 create mode 100644 tests/qapi-schema/args-name-clash.exit
 create mode 100644 tests/qapi-schema/args-name-clash.json
 create mode 100644 tests/qapi-schema/args-name-clash.out
 delete mode 100644 tests/qapi-schema/flat-union-branch-clash.err
 create mode 100644 tests/qapi-schema/flat-union-clash-branch.err
 create mode 100644 tests/qapi-schema/flat-union-clash-branch.exit
 create mode 100644 tests/qapi-schema/flat-union-clash-branch.json
 create mode 100644 tests/qapi-schema/flat-union-clash-branch.out
 create mode 100644 tests/qapi-schema/flat-union-clash-member.err
 rename tests/qapi-schema/{flat-union-branch-clash.exit => flat-union-clash-member.exit} (100%)
 rename tests/qapi-schema/{flat-union-branch-clash.json => flat-union-clash-member.json} (85%)
 create mode 100644 tests/qapi-schema/flat-union-clash-member.out
 create mode 100644 tests/qapi-schema/flat-union-clash-type.err
 create mode 100644 tests/qapi-schema/flat-union-clash-type.exit
 create mode 100644 tests/qapi-schema/flat-union-clash-type.json
 create mode 100644 tests/qapi-schema/flat-union-clash-type.out
 create mode 100644 tests/qapi-schema/flat-union-cycle.err
 create mode 100644 tests/qapi-schema/flat-union-cycle.exit
 create mode 100644 tests/qapi-schema/flat-union-cycle.json
 create mode 100644 tests/qapi-schema/flat-union-cycle.out
 create mode 100644 tests/qapi-schema/flat-union-empty.err
 create mode 100644 tests/qapi-schema/flat-union-empty.exit
 create mode 100644 tests/qapi-schema/flat-union-empty.json
 create mode 100644 tests/qapi-schema/flat-union-empty.out
 create mode 100644 tests/qapi-schema/struct-base-clash-base.err
 create mode 100644 tests/qapi-schema/struct-base-clash-base.exit
 create mode 100644 tests/qapi-schema/struct-base-clash-base.json
 create mode 100644 tests/qapi-schema/struct-base-clash-base.out
 create mode 100644 tests/qapi-schema/union-clash-branches.err
 create mode 100644 tests/qapi-schema/union-clash-branches.exit
 create mode 100644 tests/qapi-schema/union-clash-branches.json
 create mode 100644 tests/qapi-schema/union-clash-branches.out
 create mode 100644 tests/qapi-schema/union-clash-data.err
 create mode 100644 tests/qapi-schema/union-clash-data.exit
 create mode 100644 tests/qapi-schema/union-clash-data.json
 create mode 100644 tests/qapi-schema/union-clash-data.out
 create mode 100644 tests/qapi-schema/union-clash-type.err
 create mode 100644 tests/qapi-schema/union-clash-type.exit
 create mode 100644 tests/qapi-schema/union-clash-type.json
 create mode 100644 tests/qapi-schema/union-clash-type.out
 create mode 100644 tests/qapi-schema/union-empty.err
 create mode 100644 tests/qapi-schema/union-empty.exit
 create mode 100644 tests/qapi-schema/union-empty.json
 create mode 100644 tests/qapi-schema/union-empty.out
Signature · 1 line
2.4.3