From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZglZt-0007yY-U1 for qemu-devel@nongnu.org; Mon, 28 Sep 2015 23:27:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZglZq-0004gC-E6 for qemu-devel@nongnu.org; Mon, 28 Sep 2015 23:27:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZglZq-0004fs-3r for qemu-devel@nongnu.org; Mon, 28 Sep 2015 23:27:38 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1C1DBC0B64BE for ; Tue, 29 Sep 2015 03:27:37 +0000 (UTC) From: Eric Blake Date: Mon, 28 Sep 2015 21:27:13 -0600 Message-Id: <1443497249-15361-1-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v6 00/16] post-introspection cleanups, subset A List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, armbru@redhat.com, ehabkost@redhat.com Finally no pending prerequisites; this is based on current qemu.git. Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv6a and I plan forcefully update my branch with the rest of the v5 series tomorrow, at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi v6 notes: 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. Backport diffstat gets a bit lost because of the patch splits and renames: 001/16:[----] [--] 'qapi: Sort qapi-schema tests' 002/16:[0009] [FC] 'qapi: Improve 'include' error message' 003/16:[down] 'qapi: Invoke exception superclass initializer' 004/16:[0017] [FC] 'qapi: Clean up qapi.py per pep8' 005/16:[down] 'qapi: Test for various name collisions' 006/16:[down] 'qapi: Avoid assertion failure on union 'type' collision' 007/16:[----] [-C] 'qapi: Add tests for empty unions' 008/16:[0180] [FC] 'qapi: Test use of 'number' within alternates' 009/16:[0006] [FC] 'qapi: Reuse code for flat union base validation' 010/16:[down] 'qapi: Consistent generated code: prefer error 'err'' 011/16:[down] 'qapi: Consistent generated code: prefer visitor 'v'' 012/16:[down] 'qapi: Consistent generated code: prefer common labels' 013/16:[down] 'qapi: Consistent generated code: prefer common indentation= ' 014/16:[down] 'qapi: Consistent generated code: minimize push_indent() us= age' 015/16:[down] 'qapi: Share gen_err_check()' 016/16:[down] 'qapi: Share gen_visit_fields()' 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=C3=A1n'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 (16): 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() docs/qapi-code-gen.txt | 110 +++++----- qom/object.c | 18 +- qom/qom-qobject.c | 18 +- scripts/ordereddict.py | 3 +- scripts/qapi-commands.py | 124 ++++------- scripts/qapi-event.py | 55 +---- scripts/qapi-types.py | 8 +- scripts/qapi-visit.py | 182 +++++++--------= - scripts/qapi.py | 240 +++++++++++++++= ------ tests/Makefile | 171 +++++++++++---- ...-union-branch-clash.out =3D> 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 | 2 + tests/qapi-schema/args-name-clash.out | 6 + 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-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 | 15 ++ tests/qapi-schema/flat-union-clash-branch.out | 14 ++ tests/qapi-schema/flat-union-clash-member.err | 1 + ...nch-clash.exit =3D> flat-union-clash-member.exit} | 0 ...nch-clash.json =3D> 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 | 11 + 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 | 7 + 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 | 6 + tests/qapi-schema/struct-base-clash-base.out | 5 + tests/qapi-schema/union-clash-data.err | 0 tests/qapi-schema/union-clash-data.exit | 1 + tests/qapi-schema/union-clash-data.json | 4 + tests/qapi-schema/union-clash-data.out | 6 + tests/qapi-schema/union-clash-members.err | 1 + tests/qapi-schema/union-clash-members.exit | 1 + tests/qapi-schema/union-clash-members.json | 3 + tests/qapi-schema/union-clash-members.out | 0 tests/qapi-schema/union-clash-type.err | 1 + tests/qapi-schema/union-clash-type.exit | 1 + tests/qapi-schema/union-clash-type.json | 3 + 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 ++++++++++- 73 files changed, 807 insertions(+), 439 deletions(-) rename tests/qapi-schema/{flat-union-branch-clash.out =3D> alternate-emp= ty.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 =3D> flat-union-c= lash-member.exit} (100%) rename tests/qapi-schema/{flat-union-branch-clash.json =3D> flat-union-c= lash-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-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-members.err create mode 100644 tests/qapi-schema/union-clash-members.exit create mode 100644 tests/qapi-schema/union-clash-members.json create mode 100644 tests/qapi-schema/union-clash-members.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 --=20 2.4.3