From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [PATCH 00/25] qapi: Pay back some frontend technical debt
Date: Tue, 24 Sep 2019 15:28:05 +0200 [thread overview]
Message-ID: <20190924132830.15835-1-armbru@redhat.com> (raw)
When we introduced the QAPISchema intermediate representation (commit
ac88219a6c7), we took a shortcut: we left check_exprs() & friends
alone instead of moving the semantic checks to their proper place.
Time to finish this job. Topped off with error message gardening.
Based-on: <20190924123334.30645-1-armbru@redhat.com>
Markus Armbruster (25):
qapi: Tighten QAPISchemaFOO.check() assertions
qapi: Rename .owner to .defined_in
qapi: New QAPISourceInfo, replacing dict
qapi: Prefix frontend errors with an "in definition" line
qapi: Clean up member name case checking
qapi: Change frontend error messages to start with lower case
qapi: Improve reporting of member name clashes
qapi: Reorder check_FOO() parameters for consistency
qapi: Improve reporting of invalid name errors
qapi: Use check_name_str() where it suffices
qapi: Report invalid '*' prefix like any other invalid name
qapi: Move check for reserved names out of add_name()
qapi: Make check_type()'s array case a bit more obvious
qapi: Plumb info to the QAPISchemaMember
qapi: Inline check_name() into check_union()
qapi: Move context-sensitive checking to the proper place
qapi: Move context-free checking to the proper place
qapi: Improve reporting of invalid 'if' errors
qapi: Improve reporting of invalid flags
qapi: Improve reporting of missing / unknown definition keys
qapi: Avoid redundant definition references in error messages
qapi: Eliminate check_keys(), rename check_known_keys()
qapi: Improve reporting of missing documentation comment
qapi: Improve reporting of redefinition
qapi: Improve source file read error handling
qapi/qapi-schema.json | 2 +-
scripts/qapi/common.py | 1017 +++++++++--------
scripts/qapi/events.py | 2 +-
tests/qapi-schema/allow-preconfig-test.err | 3 +-
tests/qapi-schema/alternate-any.err | 3 +-
tests/qapi-schema/alternate-array.err | 3 +-
tests/qapi-schema/alternate-base.err | 3 +-
.../alternate-branch-if-invalid.err | 1 +
tests/qapi-schema/alternate-clash.err | 3 +-
.../alternate-conflict-bool-string.err | 3 +-
tests/qapi-schema/alternate-conflict-dict.err | 3 +-
.../alternate-conflict-enum-bool.err | 3 +-
.../alternate-conflict-enum-int.err | 3 +-
.../alternate-conflict-num-string.err | 3 +-
.../qapi-schema/alternate-conflict-string.err | 3 +-
tests/qapi-schema/alternate-empty.err | 3 +-
tests/qapi-schema/alternate-invalid-dict.err | 3 +-
tests/qapi-schema/alternate-nested.err | 3 +-
tests/qapi-schema/alternate-unknown.err | 3 +-
tests/qapi-schema/args-alternate.err | 3 +-
tests/qapi-schema/args-any.err | 3 +-
tests/qapi-schema/args-array-empty.err | 3 +-
tests/qapi-schema/args-array-unknown.err | 3 +-
tests/qapi-schema/args-bad-boxed.err | 3 +-
tests/qapi-schema/args-boxed-anon.err | 3 +-
tests/qapi-schema/args-boxed-string.err | 3 +-
tests/qapi-schema/args-int.err | 3 +-
tests/qapi-schema/args-invalid.err | 3 +-
tests/qapi-schema/args-member-array-bad.err | 3 +-
tests/qapi-schema/args-member-case.err | 3 +-
tests/qapi-schema/args-member-case.json | 2 +-
tests/qapi-schema/args-member-unknown.err | 3 +-
tests/qapi-schema/args-name-clash.err | 3 +-
tests/qapi-schema/args-union.err | 3 +-
tests/qapi-schema/args-unknown.err | 3 +-
tests/qapi-schema/bad-base.err | 3 +-
tests/qapi-schema/bad-data.err | 3 +-
tests/qapi-schema/bad-ident.err | 3 +-
tests/qapi-schema/bad-if-empty-list.err | 1 +
tests/qapi-schema/bad-if-empty.err | 1 +
tests/qapi-schema/bad-if-list.err | 1 +
tests/qapi-schema/bad-if.err | 1 +
tests/qapi-schema/bad-type-bool.err | 2 +-
tests/qapi-schema/bad-type-dict.err | 2 +-
tests/qapi-schema/bad-type-int.err | 2 +-
tests/qapi-schema/base-cycle-direct.err | 3 +-
tests/qapi-schema/base-cycle-indirect.err | 3 +-
tests/qapi-schema/command-int.err | 3 +-
.../qapi-schema/doc-bad-alternate-member.err | 2 +-
tests/qapi-schema/doc-bad-command-arg.err | 2 +-
tests/qapi-schema/doc-bad-symbol.err | 3 +-
tests/qapi-schema/doc-bad-union-member.err | 2 +-
tests/qapi-schema/doc-before-include.err | 2 +-
tests/qapi-schema/doc-before-pragma.err | 2 +-
tests/qapi-schema/doc-duplicated-return.err | 2 +-
tests/qapi-schema/doc-duplicated-since.err | 2 +-
tests/qapi-schema/doc-empty-arg.err | 2 +-
tests/qapi-schema/doc-empty-section.err | 2 +-
tests/qapi-schema/doc-empty-symbol.err | 2 +-
tests/qapi-schema/doc-invalid-end.err | 2 +-
tests/qapi-schema/doc-invalid-end2.err | 2 +-
tests/qapi-schema/doc-invalid-start.err | 2 +-
tests/qapi-schema/doc-missing-colon.err | 2 +-
tests/qapi-schema/doc-missing-expr.err | 2 +-
tests/qapi-schema/doc-missing-space.err | 2 +-
tests/qapi-schema/doc-missing.err | 3 +-
tests/qapi-schema/doc-no-symbol.err | 2 +-
tests/qapi-schema/double-type.err | 3 +-
tests/qapi-schema/duplicate-key.err | 2 +-
tests/qapi-schema/enum-bad-member.err | 3 +-
tests/qapi-schema/enum-bad-name.err | 3 +-
tests/qapi-schema/enum-bad-prefix.err | 3 +-
tests/qapi-schema/enum-clash-member.err | 3 +-
.../qapi-schema/enum-dict-member-unknown.err | 3 +-
tests/qapi-schema/enum-if-invalid.err | 1 +
tests/qapi-schema/enum-int-member.err | 2 +-
tests/qapi-schema/enum-member-case.err | 3 +-
tests/qapi-schema/enum-missing-data.err | 3 +-
tests/qapi-schema/enum-wrong-data.err | 3 +-
tests/qapi-schema/escape-outside-string.err | 2 +-
tests/qapi-schema/escape-too-big.err | 1 +
tests/qapi-schema/event-boxed-empty.err | 3 +-
.../qapi-schema/event-member-invalid-dict.err | 3 +-
tests/qapi-schema/event-nest-struct.err | 3 +-
tests/qapi-schema/features-bad-type.err | 3 +-
tests/qapi-schema/features-duplicate-name.err | 3 +-
tests/qapi-schema/features-if-invalid.err | 1 +
tests/qapi-schema/features-missing-name.err | 3 +-
tests/qapi-schema/features-name-bad-type.err | 3 +-
tests/qapi-schema/features-no-list.err | 3 +-
tests/qapi-schema/features-unknown-key.err | 3 +-
tests/qapi-schema/flat-union-array-branch.err | 3 +-
tests/qapi-schema/flat-union-bad-base.err | 3 +-
.../flat-union-bad-discriminator.err | 3 +-
tests/qapi-schema/flat-union-base-any.err | 3 +-
tests/qapi-schema/flat-union-base-union.err | 3 +-
tests/qapi-schema/flat-union-clash-member.err | 3 +-
.../flat-union-discriminator-bad-name.err | 3 +-
.../flat-union-discriminator-bad-name.json | 1 -
tests/qapi-schema/flat-union-empty.err | 3 +-
.../flat-union-inline-invalid-dict.err | 3 +-
tests/qapi-schema/flat-union-inline.err | 3 +-
tests/qapi-schema/flat-union-int-branch.err | 3 +-
.../flat-union-invalid-branch-key.err | 3 +-
.../flat-union-invalid-discriminator.err | 3 +-
.../flat-union-invalid-if-discriminator.err | 3 +-
tests/qapi-schema/flat-union-no-base.err | 3 +-
.../flat-union-optional-discriminator.err | 3 +-
.../flat-union-optional-discriminator.json | 1 -
.../flat-union-string-discriminator.err | 3 +-
tests/qapi-schema/funny-char.err | 2 +-
tests/qapi-schema/funny-word.err | 2 +-
tests/qapi-schema/ident-with-escape.err | 2 +-
tests/qapi-schema/include-before-err.err | 2 +-
tests/qapi-schema/include-cycle.err | 2 +-
tests/qapi-schema/include-extra-junk.err | 2 +-
tests/qapi-schema/include-nested-err.err | 2 +-
tests/qapi-schema/include-no-file.err | 2 +-
tests/qapi-schema/include-non-file.err | 2 +-
tests/qapi-schema/include-self-cycle.err | 2 +-
tests/qapi-schema/leading-comma-list.err | 2 +-
tests/qapi-schema/leading-comma-object.err | 2 +-
tests/qapi-schema/missing-colon.err | 2 +-
tests/qapi-schema/missing-comma-list.err | 2 +-
tests/qapi-schema/missing-comma-object.err | 2 +-
tests/qapi-schema/missing-type.err | 2 +-
.../nested-struct-data-invalid-dict.err | 3 +-
tests/qapi-schema/nested-struct-data.err | 3 +-
tests/qapi-schema/non-objects.err | 2 +-
tests/qapi-schema/oob-test.err | 3 +-
.../qapi-schema/pragma-doc-required-crap.err | 2 +-
tests/qapi-schema/pragma-extra-junk.err | 2 +-
.../pragma-name-case-whitelist-crap.err | 2 +-
tests/qapi-schema/pragma-non-dict.err | 2 +-
.../pragma-returns-whitelist-crap.err | 2 +-
tests/qapi-schema/pragma-unknown.err | 2 +-
tests/qapi-schema/quoted-structural-chars.err | 2 +-
tests/qapi-schema/redefined-builtin.err | 3 +-
tests/qapi-schema/redefined-command.err | 5 +-
tests/qapi-schema/redefined-event.err | 5 +-
tests/qapi-schema/redefined-type.err | 5 +-
tests/qapi-schema/reserved-command-q.err | 3 +-
tests/qapi-schema/reserved-enum-q.err | 3 +-
tests/qapi-schema/reserved-member-has.err | 3 +-
tests/qapi-schema/reserved-member-q.err | 3 +-
tests/qapi-schema/reserved-member-u.err | 3 +-
.../reserved-member-underscore.err | 3 +-
tests/qapi-schema/reserved-type-kind.err | 3 +-
tests/qapi-schema/reserved-type-list.err | 3 +-
tests/qapi-schema/returns-alternate.err | 3 +-
tests/qapi-schema/returns-array-bad.err | 3 +-
tests/qapi-schema/returns-dict.err | 3 +-
tests/qapi-schema/returns-unknown.err | 3 +-
tests/qapi-schema/returns-whitelist.err | 3 +-
tests/qapi-schema/string-code-point-127.err | 2 +-
tests/qapi-schema/string-code-point-31.err | 2 +-
tests/qapi-schema/string-control.err | 1 +
tests/qapi-schema/string-unclosed.err | 1 +
tests/qapi-schema/string-unicode.err | 1 +
tests/qapi-schema/struct-base-clash-deep.err | 3 +-
tests/qapi-schema/struct-base-clash.err | 3 +-
tests/qapi-schema/struct-data-invalid.err | 3 +-
.../qapi-schema/struct-member-if-invalid.err | 1 +
.../struct-member-invalid-dict.err | 3 +-
tests/qapi-schema/struct-member-invalid.err | 3 +-
tests/qapi-schema/trailing-comma-list.err | 2 +-
tests/qapi-schema/trailing-comma-object.err | 2 +-
tests/qapi-schema/type-bypass-bad-gen.err | 3 +-
tests/qapi-schema/unclosed-list.err | 2 +-
tests/qapi-schema/unclosed-object.err | 2 +-
tests/qapi-schema/unclosed-string.err | 2 +-
tests/qapi-schema/union-base-empty.err | 3 +-
.../union-base-no-discriminator.err | 3 +-
tests/qapi-schema/union-branch-case.err | 3 +-
tests/qapi-schema/union-branch-case.json | 4 +-
tests/qapi-schema/union-branch-if-invalid.err | 1 +
.../qapi-schema/union-branch-invalid-dict.err | 3 +-
tests/qapi-schema/union-clash-branches.err | 3 +-
tests/qapi-schema/union-empty.err | 3 +-
tests/qapi-schema/union-invalid-base.err | 3 +-
tests/qapi-schema/union-optional-branch.err | 3 +-
tests/qapi-schema/union-unknown.err | 3 +-
tests/qapi-schema/union-unknown.json | 2 +-
tests/qapi-schema/unknown-escape.err | 2 +-
tests/qapi-schema/unknown-expr-key.err | 3 +-
185 files changed, 814 insertions(+), 673 deletions(-)
create mode 100644 tests/qapi-schema/escape-too-big.err
create mode 100644 tests/qapi-schema/string-control.err
create mode 100644 tests/qapi-schema/string-unclosed.err
create mode 100644 tests/qapi-schema/string-unicode.err
--
2.21.0
next reply other threads:[~2019-09-24 14:25 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 13:28 Markus Armbruster [this message]
2019-09-24 13:28 ` [PATCH 01/25] qapi: Tighten QAPISchemaFOO.check() assertions Markus Armbruster
2019-09-24 14:39 ` Eric Blake
2019-09-24 20:18 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 02/25] qapi: Rename .owner to .defined_in Markus Armbruster
2019-09-24 14:41 ` Eric Blake
2019-09-24 13:28 ` [PATCH 03/25] qapi: New QAPISourceInfo, replacing dict Markus Armbruster
2019-09-24 14:51 ` Eric Blake
2019-09-24 20:18 ` Markus Armbruster
2019-09-24 19:12 ` Eric Blake
2019-09-25 6:40 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 04/25] qapi: Prefix frontend errors with an "in definition" line Markus Armbruster
2019-09-24 14:58 ` Eric Blake
2019-09-24 13:28 ` [PATCH 05/25] qapi: Clean up member name case checking Markus Armbruster
2019-09-24 15:07 ` Eric Blake
2019-09-24 20:20 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 06/25] qapi: Change frontend error messages to start with lower case Markus Armbruster
2019-09-24 15:17 ` Eric Blake
2019-09-24 20:35 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 07/25] qapi: Improve reporting of member name clashes Markus Armbruster
2019-09-24 15:38 ` Eric Blake
2019-09-24 13:28 ` [PATCH 08/25] qapi: Reorder check_FOO() parameters for consistency Markus Armbruster
2019-09-24 15:41 ` Eric Blake
2019-09-24 13:28 ` [PATCH 09/25] qapi: Improve reporting of invalid name errors Markus Armbruster
2019-09-24 15:48 ` Eric Blake
2019-09-24 13:28 ` [PATCH 10/25] qapi: Use check_name_str() where it suffices Markus Armbruster
2019-09-24 15:50 ` Eric Blake
2019-09-24 13:28 ` [PATCH 11/25] qapi: Report invalid '*' prefix like any other invalid name Markus Armbruster
2019-09-24 15:52 ` Eric Blake
2019-09-24 13:28 ` [PATCH 12/25] qapi: Move check for reserved names out of add_name() Markus Armbruster
2019-09-24 15:56 ` Eric Blake
2019-09-24 13:28 ` [PATCH 13/25] qapi: Make check_type()'s array case a bit more obvious Markus Armbruster
2019-09-24 15:57 ` Eric Blake
2019-09-24 13:28 ` [PATCH 14/25] qapi: Plumb info to the QAPISchemaMember Markus Armbruster
2019-09-24 16:01 ` Eric Blake
2019-09-24 13:28 ` [PATCH 15/25] qapi: Inline check_name() into check_union() Markus Armbruster
2019-09-24 16:39 ` Eric Blake
2019-09-24 13:28 ` [PATCH 16/25] qapi: Move context-sensitive checking to the proper place Markus Armbruster
2019-09-24 17:49 ` Eric Blake
2019-09-24 20:41 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 17/25] qapi: Move context-free " Markus Armbruster
2019-09-24 17:59 ` Eric Blake
2019-09-24 13:28 ` [PATCH 18/25] qapi: Improve reporting of invalid 'if' errors Markus Armbruster
2019-09-24 18:01 ` Eric Blake
2019-09-24 13:28 ` [PATCH 19/25] qapi: Improve reporting of invalid flags Markus Armbruster
2019-09-24 18:07 ` Eric Blake
2019-09-24 20:43 ` Markus Armbruster
2019-09-25 6:13 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys Markus Armbruster
2019-09-24 18:13 ` Eric Blake
2019-09-24 20:46 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 21/25] qapi: Avoid redundant definition references in error messages Markus Armbruster
2019-09-24 18:46 ` Eric Blake
2019-09-24 20:59 ` Markus Armbruster
2019-09-24 13:28 ` [PATCH 22/25] qapi: Eliminate check_keys(), rename check_known_keys() Markus Armbruster
2019-09-24 18:49 ` Eric Blake
2019-09-24 13:28 ` [PATCH 23/25] qapi: Improve reporting of missing documentation comment Markus Armbruster
2019-09-24 19:44 ` Eric Blake
2019-09-24 13:28 ` [PATCH 24/25] qapi: Improve reporting of redefinition Markus Armbruster
2019-09-24 19:53 ` Eric Blake
2019-09-24 13:28 ` [PATCH 25/25] qapi: Improve source file read error handling Markus Armbruster
2019-09-24 19:57 ` Eric Blake
2019-09-24 20:59 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190924132830.15835-1-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).