[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v12 00/36] qapi member collision, alternate layout (
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v12 00/36] qapi member collision, alternate layout (post-introspection cleanups, subset D) |
Date: |
Wed, 18 Nov 2015 01:52:35 -0700 |
No pending prerequisites; based on qemu.git master
Also available as a tag at this location:
git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv12d
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
v12 notes:
Delay 26-28 to a later subset, and instead add lots of new prereq
patches that tackle some cleanups that make case-insensitive
collision detection easier. Series is now slated for 2.6.
001/36:[----] [--] 'qapi: Track simple union tag in object.local_members'
002/36:[----] [--] 'qapi-types: Consolidate gen_struct() and gen_union()'
003/36:[----] [--] 'qapi-types: Simplify gen_struct_field[s]'
004/36:[----] [--] 'qapi: Drop obsolete tag value collision assertions'
005/36:[----] [--] 'qapi: Simplify QAPISchemaObjectTypeMember.check()'
006/36:[----] [--] 'qapi: Clean up after previous commit'
007/36:[----] [--] 'qapi: Fix up commit 7618b91's clash sanity checking change'
008/36:[----] [--] 'qapi: Eliminate QAPISchemaObjectType.check() variable
members'
009/36:[----] [--] 'qapi: Factor out QAPISchemaObjectTypeMember.check_clash()'
010/36:[----] [--] 'qapi: Simplify QAPISchemaObjectTypeVariants.check()'
011/36:[down] 'qapi: Check for qapi collisions involving variant members'
012/36:[----] [--] 'qapi: Factor out QAPISchemaObjectType.check_clash()'
013/36:[----] [--] 'qapi: Hoist tag collision check to Variants.check()'
014/36:[----] [--] 'qapi: Remove outdated tests related to QMP/branch
collisions'
015/36:[----] [--] 'qapi: Track owner of each object member'
016/36:[----] [--] 'qapi: Detect collisions in C member names'
017/36:[down] 'qapi: Fix c_name() munging'
018/36:[down] 'qapi: Remove dead visitor code'
019/36:[down] 'blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum'
020/36:[down] 'blkdebug: Avoid '.' in enum values'
021/36:[down] 'qapi: Tighten the regex on valid names'
022/36:[down] 'qapi: Don't let implicit enum MAX member collide'
023/36:[down] 'qapi: Remove dead tests for max collision'
024/36:[0018] [FC] 'cpu: Convert CpuInfo into flat union'
025/36:[down] 'qapi: Add alias for ErrorClass'
026/36:[0098] [FC] 'qapi: Change munging of CamelCase enum values'
027/36:[0049] [FC] 'qapi: Forbid case-insensitive clashes'
028/36:[down] 'qapi: Simplify QObject'
029/36:[down] 'qobject: Rename qtype_code to QType'
030/36:[down] 'qapi: Convert QType into qapi builtin enum type'
031/36:[0020] [FC] 'qapi: Simplify visiting of alternate types'
032/36:[down] 'qapi: Inline _make_implicit_tag()'
033/36:[0015] [FC] 'qapi: Fix alternates that accept 'number' but not 'int''
034/36:[----] [--] 'qapi: Add positive tests to qapi-schema-test'
035/36:[0010] [FC] 'qapi: Simplify visits of optional fields'
036/36:[down] 'qapi: Shorter visits of optional fields'
v11 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg02563.html
First half of v10 subset C has been applied, so consolidate the last
half of that along with all of subset D (which was at v9) into one
group. Address list reviews, in particular, add a new patch 21 that
makes alternate layouts a lot nicer by making qtype_code a builtin
qapi type; and new patches 18-19 that try to reduce confusion on
the use of camel_to_upper() in c_enum_const().
Probably too late to get these into 2.5, in which case 17/28 will need
tweaks to call out 2.6.
v10 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg01249.html
Split several patches, redo the middle patches from Markus to be
back in the order they were first posted, some fallout change to
my patches due to the nicer pattern of minimizing conditionals
inside .check(), by instead calling .check_clash() as needed.
Change data->err magic in tests to instead use a new helper
error_free_or_abort(). Add a patch that would prevent qapi
case-insensitive clashes.
I am redoing my subset boundaries slightly: patches 23-27 of
v9 (updating the alternate layout) will be delayed to subset D,
and 2 other patches previously posted in subset D are now here
(turning qapi clash checking into actual error messages), so
the subject line of this cover letter is slightly different.
Hopefully, we are converging on something that will be ready
for a pull request, especially for the earlier patches of this
subset.
v9 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg00652.html
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06999.html
More patches added, and several reorganized. Lots of new patches
from Markus, although not in the order originally proposed.
The first 8 patches are fairly straightforward, and could probably
be taken as-is. Patch 9 is a rewrite of v8 4/17, but in the opposite
direction (document that no sorting is done, rather than attempting
to sort), so it may need further fine-tuning. Patches 12-21
represents a fusion of Markus' and my attempts to rewrite v5 7/17
into a more-reviewable set of patches, and caused further churn
later in the series.
Patch 23 still uses tag_member.type == None; I ran out of time to
work on Markus' idea of providing an instance of QAPISchemaBuiltinType
to fill the role for 'qtype_code' without being exposed through .json
files and without breaking the invariant of a valid member.type after
check(), and wanted to get the rest of the series started under revew.
So I may need a followup patch or even a v10 of the later half of
this series after exploring that idea more.
v8 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06674.html
Minor changes when rebasing to latest, improved commit messages in
a few places, plus the addition of a few new patches. Markus started
reviewing v7, but hadn't gotten very far.
v7 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg04112.html
Patches 1-3 of the previous round have moved to subset B; patch 7
is gone, and a couple of new patches are present in this round. The
latest version of subset B made it much easier to reason about
collision detection (namely, tag values can't collide with QMP values
thanks to a named rather than anonymous union in the C type), and I
like how things turned out. I suspect the hardest part of the review
will be patches 5/14 and 7/14, although none of this has really
had much review in any earlier versions.
v6 notes:
https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg01980.html
Add some patches and rebase onto work on subset B. Rearrange some
patches from v5 (this set includes 17-20, 23, 25-27). Backport diff
gets a bit confused by one patch title changing.
Not much direct review comments, although some of the changes here
are updated based on comments made on other patches in the v5 series.
Subset D (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 (29):
qapi: Track simple union tag in object.local_members
qapi-types: Consolidate gen_struct() and gen_union()
qapi-types: Simplify gen_struct_field[s]
qapi: Check for qapi collisions involving variant members
qapi: Factor out QAPISchemaObjectType.check_clash()
qapi: Hoist tag collision check to Variants.check()
qapi: Remove outdated tests related to QMP/branch collisions
qapi: Track owner of each object member
qapi: Detect collisions in C member names
qapi: Fix c_name() munging
qapi: Remove dead visitor code
blkdebug: Merge hand-rolled and qapi BlkdebugEvent enum
blkdebug: Avoid '.' in enum values
qapi: Tighten the regex on valid names
qapi: Don't let implicit enum MAX member collide
qapi: Remove dead tests for max collision
cpu: Convert CpuInfo into flat union
qapi: Add alias for ErrorClass
qapi: Change munging of CamelCase enum values
qapi: Forbid case-insensitive clashes
qapi: Simplify QObject
qobject: Rename qtype_code to QType
qapi: Convert QType into qapi builtin enum type
qapi: Simplify visiting of alternate types
qapi: Inline _make_implicit_tag()
qapi: Fix alternates that accept 'number' but not 'int'
qapi: Add positive tests to qapi-schema-test
qapi: Simplify visits of optional fields
qapi: Shorter visits of optional fields
Markus Armbruster (7):
qapi: Drop obsolete tag value collision assertions
qapi: Simplify QAPISchemaObjectTypeMember.check()
qapi: Clean up after previous commit
qapi: Fix up commit 7618b91's clash sanity checking change
qapi: Eliminate QAPISchemaObjectType.check() variable members
qapi: Factor out QAPISchemaObjectTypeMember.check_clash()
qapi: Simplify QAPISchemaObjectTypeVariants.check()
block.c | 2 +-
block/blkdebug.c | 79 +------
block/parallels.c | 4 +-
block/qapi.c | 4 +-
block/qcow2.c | 2 +-
block/quorum.c | 2 +-
block/raw-posix.c | 2 +-
blockdev.c | 2 +-
cpus.c | 31 +--
docs/blkdebug.txt | 7 +-
docs/qapi-code-gen.txt | 34 +--
hmp.c | 44 ++--
hw/char/escc.c | 2 +-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/input/hid.c | 6 +-
hw/input/ps2.c | 6 +-
hw/input/virtio-input-hid.c | 12 +-
include/block/block.h | 62 +-----
include/block/block_int.h | 2 +-
include/hw/qdev-core.h | 2 +-
include/migration/migration.h | 4 +-
include/qapi/error.h | 14 ++
include/qapi/qmp/qobject.h | 53 ++---
include/qapi/visitor-impl.h | 8 +-
include/qapi/visitor.h | 22 +-
migration/migration.c | 4 +-
monitor.c | 18 +-
net/net.c | 4 +-
qapi-schema.json | 120 +++++++++--
qapi/block-core.json | 20 +-
qapi/common.json | 5 +-
qapi/opts-visitor.c | 2 +-
qapi/qapi-visit-core.c | 10 +-
qapi/qmp-dispatch.c | 2 +-
qapi/qmp-input-visitor.c | 10 +-
qapi/string-input-visitor.c | 3 +-
qemu-nbd.c | 2 +-
qmp-commands.hx | 4 +
qobject/qbool.c | 7 +-
qobject/qdict.c | 10 +-
qobject/qfloat.c | 7 +-
qobject/qint.c | 7 +-
qobject/qlist.c | 7 +-
qobject/qnull.c | 13 +-
qobject/qstring.c | 7 +-
replay/replay-input.c | 8 +-
scripts/qapi-types.py | 116 +++-------
scripts/qapi-visit.py | 35 +++-
scripts/qapi.py | 233 ++++++++++++++-------
tests/Makefile | 9 +-
tests/qapi-schema/alternate-empty.out | 3 +-
tests/qapi-schema/args-case-clash.err | 1 +
.../{union-max.exit => args-case-clash.exit} | 0
tests/qapi-schema/args-case-clash.json | 4 +
.../{union-max.out => args-case-clash.out} | 0
tests/qapi-schema/args-name-clash.err | 1 +
tests/qapi-schema/args-name-clash.exit | 2 +-
tests/qapi-schema/args-name-clash.json | 5 +-
tests/qapi-schema/args-name-clash.out | 6 -
tests/qapi-schema/command-type-case-clash.err | 1 +
...lash-type.exit => command-type-case-clash.exit} | 0
tests/qapi-schema/command-type-case-clash.json | 3 +
...-clash-type.out => command-type-case-clash.out} | 0
tests/qapi-schema/comments.out | 2 +
tests/qapi-schema/empty.out | 2 +
tests/qapi-schema/enum-max-member.err | 1 -
tests/qapi-schema/enum-max-member.exit | 1 -
tests/qapi-schema/enum-max-member.json | 3 -
tests/qapi-schema/enum-max-member.out | 0
tests/qapi-schema/event-case.out | 2 +
tests/qapi-schema/event-max.err | 1 -
tests/qapi-schema/event-max.exit | 1 -
tests/qapi-schema/event-max.json | 2 -
tests/qapi-schema/event-max.out | 0
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-type.err | 1 -
tests/qapi-schema/flat-union-clash-type.json | 14 --
tests/qapi-schema/flat-union-empty.out | 2 +
tests/qapi-schema/ident-with-escape.out | 2 +
tests/qapi-schema/include-relpath.out | 2 +
tests/qapi-schema/include-repetition.out | 2 +
tests/qapi-schema/include-simple.out | 2 +
tests/qapi-schema/indented-expr.out | 2 +
tests/qapi-schema/qapi-schema-test.json | 21 +-
tests/qapi-schema/qapi-schema-test.out | 39 +++-
tests/qapi-schema/reserved-member-underscore.err | 1 +
...h-type.exit => reserved-member-underscore.exit} | 0
tests/qapi-schema/reserved-member-underscore.json | 4 +
...ash-type.out => reserved-member-underscore.out} | 0
tests/qapi-schema/union-clash-data.out | 3 +
tests/qapi-schema/union-clash-type.err | 1 -
tests/qapi-schema/union-clash-type.json | 9 -
tests/qapi-schema/union-empty.out | 3 +
tests/qapi-schema/union-max.err | 1 -
tests/qapi-schema/union-max.json | 3 -
tests/qemu-iotests/026 | 18 +-
tests/qemu-iotests/026.out | 80 +++----
tests/qemu-iotests/026.out.nocache | 80 +++----
tests/qemu-iotests/077 | 24 +--
tests/test-qmp-commands.c | 4 +
tests/test-qmp-input-visitor.c | 29 ++-
tests/test-qmp-output-visitor.c | 10 +-
tests/test-string-output-visitor.c | 4 +-
tpm.c | 10 +-
ui/cocoa.m | 6 +-
ui/console.c | 2 +-
ui/gtk.c | 4 +-
ui/input-keymap.c | 4 +-
ui/input-legacy.c | 10 +-
ui/input.c | 6 +-
ui/sdl.c | 6 +-
ui/sdl2.c | 6 +-
ui/spice-input.c | 6 +-
ui/vnc.c | 6 +-
vl.c | 18 +-
119 files changed, 806 insertions(+), 786 deletions(-)
create mode 100644 tests/qapi-schema/args-case-clash.err
rename tests/qapi-schema/{union-max.exit => args-case-clash.exit} (100%)
create mode 100644 tests/qapi-schema/args-case-clash.json
rename tests/qapi-schema/{union-max.out => args-case-clash.out} (100%)
create mode 100644 tests/qapi-schema/command-type-case-clash.err
rename tests/qapi-schema/{union-clash-type.exit =>
command-type-case-clash.exit} (100%)
create mode 100644 tests/qapi-schema/command-type-case-clash.json
rename tests/qapi-schema/{union-clash-type.out => command-type-case-clash.out}
(100%)
delete mode 100644 tests/qapi-schema/enum-max-member.err
delete mode 100644 tests/qapi-schema/enum-max-member.exit
delete mode 100644 tests/qapi-schema/enum-max-member.json
delete mode 100644 tests/qapi-schema/enum-max-member.out
delete mode 100644 tests/qapi-schema/event-max.err
delete mode 100644 tests/qapi-schema/event-max.exit
delete mode 100644 tests/qapi-schema/event-max.json
delete mode 100644 tests/qapi-schema/event-max.out
delete mode 100644 tests/qapi-schema/flat-union-clash-branch.err
delete mode 100644 tests/qapi-schema/flat-union-clash-branch.exit
delete mode 100644 tests/qapi-schema/flat-union-clash-branch.json
delete mode 100644 tests/qapi-schema/flat-union-clash-branch.out
delete mode 100644 tests/qapi-schema/flat-union-clash-type.err
delete mode 100644 tests/qapi-schema/flat-union-clash-type.json
create mode 100644 tests/qapi-schema/reserved-member-underscore.err
rename tests/qapi-schema/{flat-union-clash-type.exit =>
reserved-member-underscore.exit} (100%)
create mode 100644 tests/qapi-schema/reserved-member-underscore.json
rename tests/qapi-schema/{flat-union-clash-type.out =>
reserved-member-underscore.out} (100%)
delete mode 100644 tests/qapi-schema/union-clash-type.err
delete mode 100644 tests/qapi-schema/union-clash-type.json
delete mode 100644 tests/qapi-schema/union-max.err
delete mode 100644 tests/qapi-schema/union-max.json
--
2.4.3
- [Qemu-devel] [PATCH v12 00/36] qapi member collision, alternate layout (post-introspection cleanups, subset D),
Eric Blake <=
- [Qemu-devel] [PATCH v12 04/36] qapi: Drop obsolete tag value collision assertions, Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 05/36] qapi: Simplify QAPISchemaObjectTypeMember.check(), Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 10/36] qapi: Simplify QAPISchemaObjectTypeVariants.check(), Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 13/36] qapi: Hoist tag collision check to Variants.check(), Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 03/36] qapi-types: Simplify gen_struct_field[s], Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 11/36] qapi: Check for qapi collisions involving variant members, Eric Blake, 2015/11/18
- [Qemu-devel] [PATCH v12 01/36] qapi: Track simple union tag in object.local_members, Eric Blake, 2015/11/18