Skip to content

Our QAPI parser is a hack, replace it

Markus Armbruster qemu-devel 2 versions – Applied

Status from this message: Applied. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 3 repliesApplied
  2. v19 patches 22 repliesSuperseded

Changes in v2 from the cover letter

* Straightforward rebase
* A few more tests in 1/9, in part suggested by Eric

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/9tests: QAPI schema parser testsconfigure tests/Makefile tests/qapi-schema/comments.err +56 more+121 -32 replies
2/9tests: Use qapi-schema-test.json as schema parser testtests/Makefile tests/qapi-schema/qapi-schema-test.err tests/qapi-schema/qapi-schema-test.exit +2 more+24 -40 replies
3/9qapi.py: Restructure lexer and parserscripts/qapi.py tests/qapi-schema/indented-expr.out tests/qapi-schema/missing-colon.out +3 more+88 -870 replies
4/9qapi.py: Decent syntax error reportingscripts/qapi.py tests/qapi-schema/test-qapi.py tests/qapi-schema/unclosed-string.err+30 -30 replies
5/9qapi.py: Reject invalid characters in schema filescripts/qapi.py tests/qapi-schema/comments.err tests/qapi-schema/comments.exit +4 more+6 -80 replies
6/9qapi.py: Fix schema parser to check syntax systematicallyscripts/qapi.py tests/qapi-schema/missing-colon.err tests/qapi-schema/missing-colon.exit +15 more+42 -320 replies
7/9qapi.py: Fix diagnosing non-objects at a schema's top-levelscripts/qapi.py tests/qapi-schema/non-objects.err tests/qapi-schema/quoted-structural-chars.err+8 -60 replies
8/9qapi.py: Rename expr_eval to expr in parse_schema()scripts/qapi.py+9 -90 replies
9/9qapi.py: Permit comments starting anywhere on the linescripts/qapi.py tests/qapi-schema/comments.err tests/qapi-schema/comments.exit +1 more+5 -40 replies

Reviews trailers per patch

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

PatchEric Blake
1/9
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9R-b
7/9R-b
8/9R-b
9/9R-b

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

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/9] Our QAPI parser is a hack, replace it

If you think I'm exaggerating, check out the list of issues in PATCH 3/9.

v2:
* Straightforward rebase
* A few more tests in 1/9, in part suggested by Eric

Markus Armbruster (9):
tests: QAPI schema parser tests
tests: Use qapi-schema-test.json as schema parser test qapi.py: Restructure lexer and parser
qapi.py: Decent syntax error reporting
qapi.py: Reject invalid characters in schema file qapi.py: Fix schema parser to check syntax systematically qapi.py: Fix diagnosing non-objects at a schema's top-level qapi.py: Rename expr_eval to expr in parse_schema() qapi.py: Permit comments starting anywhere on the line

 configure                                          |   2 +-
 scripts/qapi.py                                    | 227 +++++++++++++--------
 tests/Makefile                                     |  30 ++-
 tests/qapi-schema/comments.exit                    |   1 +
 tests/qapi-schema/comments.json                    |   4 +
 tests/qapi-schema/comments.out                     |   3 +
 tests/qapi-schema/empty.exit                       |   1 +
 tests/qapi-schema/empty.out                        |   3 +
 tests/qapi-schema/funny-char.err                   |   1 +
 tests/qapi-schema/funny-char.exit                  |   1 +
 tests/qapi-schema/funny-char.json                  |   2 +
 tests/qapi-schema/indented-expr.exit               |   1 +
 tests/qapi-schema/indented-expr.json               |   2 +
 tests/qapi-schema/indented-expr.out                |   3 +
 tests/qapi-schema/missing-colon.err                |   1 +
 tests/qapi-schema/missing-colon.exit               |   1 +
 tests/qapi-schema/missing-colon.json               |   2 +
 tests/qapi-schema/missing-comma-list.err           |   1 +
 tests/qapi-schema/missing-comma-list.exit          |   1 +
 tests/qapi-schema/missing-comma-list.json          |   2 +
 tests/qapi-schema/missing-comma-object.err         |   1 +
 tests/qapi-schema/missing-comma-object.exit        |   1 +
 tests/qapi-schema/missing-comma-object.json        |   2 +
 tests/qapi-schema/non-objects.err                  |   1 +
 tests/qapi-schema/non-objects.exit                 |   1 +
 tests/qapi-schema/non-objects.json                 |   2 +
 tests/qapi-schema/qapi-schema-test.exit            |   1 +
 .../qapi-schema/qapi-schema-test.json              |   0
 tests/qapi-schema/qapi-schema-test.out             |  19 ++
 tests/qapi-schema/quoted-structural-chars.err      |   1 +
 tests/qapi-schema/quoted-structural-chars.exit     |   1 +
 tests/qapi-schema/quoted-structural-chars.json     |   1 +
 tests/qapi-schema/test-qapi.py                     |  27 +++
 tests/qapi-schema/trailing-comma-list.err          |   1 +
 tests/qapi-schema/trailing-comma-list.exit         |   1 +
 tests/qapi-schema/trailing-comma-list.json         |   2 +
 tests/qapi-schema/trailing-comma-object.err        |   1 +
 tests/qapi-schema/trailing-comma-object.exit       |   1 +
 tests/qapi-schema/trailing-comma-object.json       |   2 +
 tests/qapi-schema/unclosed-list.err                |   1 +
 tests/qapi-schema/unclosed-list.exit               |   1 +
 tests/qapi-schema/unclosed-list.json               |   1 +
 tests/qapi-schema/unclosed-object.err              |   1 +
 tests/qapi-schema/unclosed-object.exit             |   1 +
 tests/qapi-schema/unclosed-object.json             |   1 +
 tests/qapi-schema/unclosed-string.err              |   1 +
 tests/qapi-schema/unclosed-string.exit             |   1 +
 tests/qapi-schema/unclosed-string.json             |   2 +
 48 files changed, 271 insertions(+), 94 deletions(-)
 create mode 100644 tests/qapi-schema/comments.err
 create mode 100644 tests/qapi-schema/comments.exit
 create mode 100644 tests/qapi-schema/comments.json
 create mode 100644 tests/qapi-schema/comments.out
 create mode 100644 tests/qapi-schema/empty.err
 create mode 100644 tests/qapi-schema/empty.exit
 create mode 100644 tests/qapi-schema/empty.json
 create mode 100644 tests/qapi-schema/empty.out
 create mode 100644 tests/qapi-schema/funny-char.err
 create mode 100644 tests/qapi-schema/funny-char.exit
 create mode 100644 tests/qapi-schema/funny-char.json
 create mode 100644 tests/qapi-schema/funny-char.out
 create mode 100644 tests/qapi-schema/indented-expr.err
 create mode 100644 tests/qapi-schema/indented-expr.exit
 create mode 100644 tests/qapi-schema/indented-expr.json
 create mode 100644 tests/qapi-schema/indented-expr.out
 create mode 100644 tests/qapi-schema/missing-colon.err
 create mode 100644 tests/qapi-schema/missing-colon.exit
 create mode 100644 tests/qapi-schema/missing-colon.json
 create mode 100644 tests/qapi-schema/missing-colon.out
 create mode 100644 tests/qapi-schema/missing-comma-list.err
 create mode 100644 tests/qapi-schema/missing-comma-list.exit
 create mode 100644 tests/qapi-schema/missing-comma-list.json
 create mode 100644 tests/qapi-schema/missing-comma-list.out
 create mode 100644 tests/qapi-schema/missing-comma-object.err
 create mode 100644 tests/qapi-schema/missing-comma-object.exit
 create mode 100644 tests/qapi-schema/missing-comma-object.json
 create mode 100644 tests/qapi-schema/missing-comma-object.out
 create mode 100644 tests/qapi-schema/non-objects.err
 create mode 100644 tests/qapi-schema/non-objects.exit
 create mode 100644 tests/qapi-schema/non-objects.json
 create mode 100644 tests/qapi-schema/non-objects.out
 create mode 100644 tests/qapi-schema/qapi-schema-test.err
 create mode 100644 tests/qapi-schema/qapi-schema-test.exit
 rename qapi-schema-test.json => tests/qapi-schema/qapi-schema-test.json (100%)
 create mode 100644 tests/qapi-schema/qapi-schema-test.out
 create mode 100644 tests/qapi-schema/quoted-structural-chars.err
 create mode 100644 tests/qapi-schema/quoted-structural-chars.exit
 create mode 100644 tests/qapi-schema/quoted-structural-chars.json
 create mode 100644 tests/qapi-schema/quoted-structural-chars.out
 create mode 100644 tests/qapi-schema/test-qapi.py
 create mode 100644 tests/qapi-schema/trailing-comma-list.err
 create mode 100644 tests/qapi-schema/trailing-comma-list.exit
 create mode 100644 tests/qapi-schema/trailing-comma-list.json
 create mode 100644 tests/qapi-schema/trailing-comma-list.out
 create mode 100644 tests/qapi-schema/trailing-comma-object.err
 create mode 100644 tests/qapi-schema/trailing-comma-object.exit
 create mode 100644 tests/qapi-schema/trailing-comma-object.json
 create mode 100644 tests/qapi-schema/trailing-comma-object.out
 create mode 100644 tests/qapi-schema/unclosed-list.err
 create mode 100644 tests/qapi-schema/unclosed-list.exit
 create mode 100644 tests/qapi-schema/unclosed-list.json
 create mode 100644 tests/qapi-schema/unclosed-list.out
 create mode 100644 tests/qapi-schema/unclosed-object.err
 create mode 100644 tests/qapi-schema/unclosed-object.exit
 create mode 100644 tests/qapi-schema/unclosed-object.json
 create mode 100644 tests/qapi-schema/unclosed-object.out
 create mode 100644 tests/qapi-schema/unclosed-string.err
 create mode 100644 tests/qapi-schema/unclosed-string.exit
 create mode 100644 tests/qapi-schema/unclosed-string.json
 create mode 100644 tests/qapi-schema/unclosed-string.out
Signature · 1 line
1.7.11.7