All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Juan Quintela" <quintela@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	jsnow@redhat.com, "Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PATCH v2 0/9] qapi: untie 'if' conditions from C preprocessor
Date: Thu,  5 Nov 2020 16:27:59 +0400	[thread overview]
Message-ID: <20201105122808.1182973-1-marcandre.lureau@redhat.com> (raw)

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




             reply	other threads:[~2020-11-05 12:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 12:27 marcandre.lureau [this message]
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

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=20201105122808.1182973-1-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.