qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] qapi: untie 'if' conditions from C preprocessor
@ 2020-11-05 12:27 marcandre.lureau
  2020-11-05 12:28 ` [PATCH v2 1/9] qapi: replace List[str] by QAPISchemaIf marcandre.lureau
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-11-05 12:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael Roth, Juan Quintela, Markus Armbruster,
	Dr. David Alan Gilbert, Gerd Hoffmann, Marc-André Lureau,
	Paolo Bonzini, jsnow, Eduardo Habkost

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

This series makes the 'if' conditions less liberal, by formalizing a simple
expression tree based on bare boolean logic of configure option identifiers.

(this will allow to express conditions in Rust in my QAPI-Rust PoC series, but
it is worth a standalone post)

This is based on John Snow QAPI cleanup branch:
https://gitlab.com/jsnow/qemu/-/tree/python-qapi-cleanup-pt6

thanks

v2:
 - fix the normalization step to handle recursive expr
 - replace IfCond by QAPISchemaIf (JohnS)
 - commit message and documentation tweaks
 - mypy/flake8/isort

Marc-André Lureau (9):
  qapi: replace List[str] by QAPISchemaIf
  qapi: move gen_if/gen_endif to QAPIIfSchema
  qapi: start building an 'if' predicate tree
  qapi: introduce IfPredicateList and IfAny
  qapi: add IfNot
  qapi: normalize 'if' condition to IfPredicate tree
  qapi: convert 'if' C expressions to the new literal form
  qapi: make 'if' condition strings simple identifiers
  docs: update the documentation about schema configuration

 docs/devel/qapi-code-gen.txt                  |  32 ++--
 docs/sphinx/qapidoc.py                        |   6 +-
 qapi/block-core.json                          |  16 +-
 qapi/char.json                                |   8 +-
 qapi/machine-target.json                      |  28 +++-
 qapi/migration.json                           |  10 +-
 qapi/misc-target.json                         |  35 +++--
 qapi/ui.json                                  |  48 +++---
 scripts/qapi/commands.py                      |   3 +-
 scripts/qapi/common.py                        |  85 +++++++++--
 scripts/qapi/events.py                        |   3 +-
 scripts/qapi/expr.py                          |  64 +++++---
 scripts/qapi/gen.py                           |  21 +--
 scripts/qapi/introspect.py                    |  36 +++--
 scripts/qapi/schema.py                        | 138 ++++++++++++------
 scripts/qapi/types.py                         |  39 +++--
 scripts/qapi/visit.py                         |  23 ++-
 .../alternate-branch-if-invalid.err           |   2 +-
 tests/qapi-schema/bad-if-empty.err            |   2 +-
 tests/qapi-schema/bad-if-list.err             |   2 +-
 tests/qapi-schema/bad-if.err                  |   3 +-
 tests/qapi-schema/bad-if.json                 |   2 +-
 tests/qapi-schema/doc-good.json               |   6 +-
 tests/qapi-schema/doc-good.out                |  12 +-
 tests/qapi-schema/enum-if-invalid.err         |   3 +-
 tests/qapi-schema/features-if-invalid.err     |   2 +-
 tests/qapi-schema/features-missing-name.json  |   2 +-
 tests/qapi-schema/qapi-schema-test.json       |  55 +++----
 tests/qapi-schema/qapi-schema-test.out        |  63 ++++----
 .../qapi-schema/struct-member-if-invalid.err  |   2 +-
 tests/qapi-schema/union-branch-if-invalid.err |   2 +-
 tests/test-qmp-cmds.c                         |   1 +
 32 files changed, 456 insertions(+), 298 deletions(-)

-- 
2.29.0




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-05 14:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-05 12:27 [PATCH v2 0/9] qapi: untie 'if' conditions from C preprocessor marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 1/9] qapi: replace List[str] by QAPISchemaIf marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 2/9] qapi: move gen_if/gen_endif to QAPIIfSchema marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 3/9] qapi: start building an 'if' predicate tree marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 4/9] qapi: introduce IfPredicateList and IfAny marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 5/9] qapi: add IfNot marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 6/9] qapi: normalize 'if' condition to IfPredicate tree marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 7/9] qapi: convert 'if' C expressions to the new literal form marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 8/9] qapi: make 'if' condition strings simple identifiers marcandre.lureau
2020-11-05 12:28 ` [PATCH v2 9/9] docs: update the documentation about schema configuration marcandre.lureau
2020-11-05 13:43   ` Eric Blake
2020-11-05 14:40     ` Marc-André Lureau

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).