All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: QEMU <qemu-devel@nongnu.org>
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 00/27] qapi: add #if pre-processor conditions to generated code (part 2)
Date: Wed, 3 Oct 2018 00:56:11 +0400	[thread overview]
Message-ID: <CAJ+F1C+LBKs5RRzLJOZuwOaWUyGyMdUNnGir1u2eJyGybH-Vug@mail.gmail.com> (raw)
In-Reply-To: <20180706105753.26700-1-marcandre.lureau@redhat.com>

Hi

On Fri, Jul 6, 2018 at 2:59 PM Marc-André Lureau
<marcandre.lureau@redhat.com> wrote:
>
> Hi,
>
> This is the second part of the "add #if pre-processor conditions to
> generated code" series, adding schema member conditions (roughly
> 16-38/49).
>
> Members can be exploded as dictionnary with 'type'/'if' keys:
>
> { 'struct': 'TestIfStruct', 'data':
>   { 'foo': 'int',
>     'bar': { 'type': 'int', 'if': 'defined(TEST_IF_STRUCT_BAR)'} } }
>
> Enum values can be exploded as dictionnary with 'type'/'if' keys:
>
> { 'enum': 'TestIfEnum', 'data':
>   [ 'foo',
>     { 'name' : 'bar', 'if': 'defined(TEST_IF_ENUM_BAR)' } ] }
>
> v6:
> - subset of v5 series: add schema member conditions
> - split "qapi: factor out check_known_keys()", error report improvements
> - add a patch to "qapi: include osdep.h in type headers" to avoid
>   potential build configuration change issues
> - rebased, on top of Markus's qapi-next branch (first 4 patches,
>   included for patchew testing)
>
> Marc-André Lureau (26):
>   qmp-shell: learn to send commands with quoted arguments
>   json: remove useless return value from lexer/parser
>   tests: change /0.15/* tests to /qmp/*
>   qapi: include osdep.h in type headers
>   qapi: do not define enumeration value explicitly
>   qapi: rename QAPISchemaEnumType.values to .members
>   qapi: change enum visitor and gen_enum* to take QAPISchemaMember
>   tests: print enum type members more like object type members
>   qapi: factor out checking for keys
>   qapi: improve reporting of unknown or missing keys
>   qapi: add a dictionnary form with 'name' key for enum members
>   qapi: add 'if' to enum members
>   qapi-event: add 'if' condition to implicit event enum
>   qapi: rename allow_dict to allow_implicit
>   qapi: add a dictionary form with 'type' key for members
>   qapi: add 'if' to implicit struct members
>   qapi: add an error in case a discriminator is conditionnal
>   qapi: add 'if' on union members
>   qapi: add 'if' to alternate members
>   qapi: add #if conditions to generated code members
>   docs: document schema configuration
>   qapi: add 'If:' condition to enum values documentation
>   qapi: add 'If:' condition to struct members documentation
>   qapi: add condition to variants documentation
>   qapi: add more conditions to SPICE
>   qapi: add conditions to REPLICATION type/commands on the schema
>
> Markus Armbruster (1):
>   qapi: Fix some pycodestyle-3 complaints

Rebased series updated on github branch:
https://github.com/elmarco/qemu/commits/qapi-if

(mostly unchanged, except patch "add #if conditions to generated code
members" which had to accommodate with Eric's introspection comment
patch)

thanks


>  qapi/block-core.json                          |  13 +-
>  qapi/char.json                                |  16 +-
>  qapi/migration.json                           |  12 +-
>  scripts/qapi/common.py                        | 256 ++++++++++++------
>  scripts/qapi/doc.py                           |  16 +-
>  scripts/qapi/events.py                        |   2 +-
>  scripts/qapi/introspect.py                    |  16 +-
>  scripts/qapi/types.py                         |  11 +-
>  scripts/qapi/visit.py                         |  10 +-
>  include/qapi/qmp/json-lexer.h                 |   4 +-
>  include/qapi/qmp/json-streamer.h              |   4 +-
>  migration/colo.c                              |  16 +-
>  monitor.c                                     |   5 -
>  qobject/json-lexer.c                          |  23 +-
>  qobject/json-streamer.c                       |   8 +-
>  tests/test-qmp-cmds.c                         |  10 +-
>  docs/devel/qapi-code-gen.txt                  |  19 ++
>  scripts/qmp/qmp-shell                         |   3 +-
>  tests/Makefile.include                        |   8 +-
>  tests/qapi-schema/alternate-base.err          |   1 +
>  tests/qapi-schema/alternate-invalid-dict.err  |   1 +
>  ...ember.exit => alternate-invalid-dict.exit} |   0
>  tests/qapi-schema/alternate-invalid-dict.json |   4 +
>  ...-member.out => alternate-invalid-dict.out} |   0
>  tests/qapi-schema/comments.out                |  14 +-
>  tests/qapi-schema/doc-bad-section.out         |  13 +-
>  tests/qapi-schema/doc-good.json               |  11 +-
>  tests/qapi-schema/doc-good.out                |  22 +-
>  tests/qapi-schema/doc-good.texi               |   8 +-
>  tests/qapi-schema/double-type.err             |   1 +
>  tests/qapi-schema/empty.out                   |   9 +-
>  tests/qapi-schema/enum-bad-member.err         |   1 +
>  tests/qapi-schema/enum-bad-member.exit        |   1 +
>  tests/qapi-schema/enum-bad-member.json        |   2 +
>  tests/qapi-schema/enum-bad-member.out         |   0
>  .../qapi-schema/enum-dict-member-unknown.err  |   2 +
>  .../qapi-schema/enum-dict-member-unknown.exit |   1 +
>  .../qapi-schema/enum-dict-member-unknown.json |   2 +
>  .../qapi-schema/enum-dict-member-unknown.out  |   0
>  tests/qapi-schema/enum-dict-member.err        |   1 -
>  tests/qapi-schema/enum-dict-member.json       |   2 -
>  tests/qapi-schema/enum-if-invalid.err         |   1 +
>  tests/qapi-schema/enum-if-invalid.exit        |   1 +
>  tests/qapi-schema/enum-if-invalid.json        |   3 +
>  tests/qapi-schema/enum-if-invalid.out         |   0
>  tests/qapi-schema/enum-missing-data.err       |   2 +-
>  tests/qapi-schema/event-case.out              |   9 +-
>  tests/qapi-schema/event-nest-struct.err       |   2 +-
>  tests/qapi-schema/flat-union-inline.err       |   2 +-
>  .../flat-union-invalid-if-discriminator.err   |   1 +
>  .../flat-union-invalid-if-discriminator.exit  |   1 +
>  .../flat-union-invalid-if-discriminator.json  |  17 ++
>  .../flat-union-invalid-if-discriminator.out   |   0
>  tests/qapi-schema/ident-with-escape.out       |   9 +-
>  tests/qapi-schema/include-relpath.out         |  14 +-
>  tests/qapi-schema/include-repetition.out      |  14 +-
>  tests/qapi-schema/include-simple.out          |  14 +-
>  tests/qapi-schema/indented-expr.out           |   9 +-
>  tests/qapi-schema/nested-struct-data.err      |   2 +-
>  tests/qapi-schema/qapi-schema-test.json       |  38 ++-
>  tests/qapi-schema/qapi-schema-test.out        |  76 +++++-
>  .../struct-member-invalid-dict.err            |   1 +
>  .../struct-member-invalid-dict.exit           |   1 +
>  .../struct-member-invalid-dict.json           |   3 +
>  .../struct-member-invalid-dict.out            |   0
>  tests/qapi-schema/test-qapi.py                |  22 +-
>  .../qapi-schema/union-branch-invalid-dict.err |   1 +
>  .../union-branch-invalid-dict.exit            |   1 +
>  .../union-branch-invalid-dict.json            |   4 +
>  .../qapi-schema/union-branch-invalid-dict.out |   0
>  tests/qapi-schema/unknown-expr-key.err        |   3 +-
>  tests/qapi-schema/unknown-expr-key.json       |   2 +-
>  72 files changed, 574 insertions(+), 227 deletions(-)
>  create mode 100644 tests/qapi-schema/alternate-invalid-dict.err
>  rename tests/qapi-schema/{enum-dict-member.exit => alternate-invalid-dict.exit} (100%)
>  create mode 100644 tests/qapi-schema/alternate-invalid-dict.json
>  rename tests/qapi-schema/{enum-dict-member.out => alternate-invalid-dict.out} (100%)
>  create mode 100644 tests/qapi-schema/enum-bad-member.err
>  create mode 100644 tests/qapi-schema/enum-bad-member.exit
>  create mode 100644 tests/qapi-schema/enum-bad-member.json
>  create mode 100644 tests/qapi-schema/enum-bad-member.out
>  create mode 100644 tests/qapi-schema/enum-dict-member-unknown.err
>  create mode 100644 tests/qapi-schema/enum-dict-member-unknown.exit
>  create mode 100644 tests/qapi-schema/enum-dict-member-unknown.json
>  create mode 100644 tests/qapi-schema/enum-dict-member-unknown.out
>  delete mode 100644 tests/qapi-schema/enum-dict-member.err
>  delete mode 100644 tests/qapi-schema/enum-dict-member.json
>  create mode 100644 tests/qapi-schema/enum-if-invalid.err
>  create mode 100644 tests/qapi-schema/enum-if-invalid.exit
>  create mode 100644 tests/qapi-schema/enum-if-invalid.json
>  create mode 100644 tests/qapi-schema/enum-if-invalid.out
>  create mode 100644 tests/qapi-schema/flat-union-invalid-if-discriminator.err
>  create mode 100644 tests/qapi-schema/flat-union-invalid-if-discriminator.exit
>  create mode 100644 tests/qapi-schema/flat-union-invalid-if-discriminator.json
>  create mode 100644 tests/qapi-schema/flat-union-invalid-if-discriminator.out
>  create mode 100644 tests/qapi-schema/struct-member-invalid-dict.err
>  create mode 100644 tests/qapi-schema/struct-member-invalid-dict.exit
>  create mode 100644 tests/qapi-schema/struct-member-invalid-dict.json
>  create mode 100644 tests/qapi-schema/struct-member-invalid-dict.out
>  create mode 100644 tests/qapi-schema/union-branch-invalid-dict.err
>  create mode 100644 tests/qapi-schema/union-branch-invalid-dict.exit
>  create mode 100644 tests/qapi-schema/union-branch-invalid-dict.json
>  create mode 100644 tests/qapi-schema/union-branch-invalid-dict.out
>
> --
> 2.18.0.rc1
>
>


-- 
Marc-André Lureau

  parent reply	other threads:[~2018-10-02 21:05 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06 10:57 [Qemu-devel] [PATCH v6 00/27] qapi: add #if pre-processor conditions to generated code (part 2) Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 01/27] qmp-shell: learn to send commands with quoted arguments Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 02/27] json: remove useless return value from lexer/parser Marc-André Lureau
2018-07-08  6:09   ` Thomas Huth
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 03/27] tests: change /0.15/* tests to /qmp/* Marc-André Lureau
2018-07-08  6:05   ` Thomas Huth
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 04/27] qapi: Fix some pycodestyle-3 complaints Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 05/27] qapi: include osdep.h in type headers Marc-André Lureau
2018-12-04 15:23   ` Markus Armbruster
2018-12-04 15:32     ` Marc-André Lureau
2018-12-04 16:30       ` Eric Blake
2018-12-04 16:37       ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 06/27] qapi: do not define enumeration value explicitly Marc-André Lureau
2018-12-05 13:19   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 07/27] qapi: rename QAPISchemaEnumType.values to .members Marc-André Lureau
2018-12-05 13:42   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 08/27] qapi: change enum visitor and gen_enum* to take QAPISchemaMember Marc-André Lureau
2018-12-05 14:02   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 09/27] tests: print enum type members more like object type members Marc-André Lureau
2018-12-05 14:04   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 10/27] qapi: factor out checking for keys Marc-André Lureau
2018-12-05 16:26   ` Markus Armbruster
2018-12-07 11:26     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 11/27] qapi: improve reporting of unknown or missing keys Marc-André Lureau
2018-12-05 16:38   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 12/27] qapi: add a dictionnary form with 'name' key for enum members Marc-André Lureau
2018-12-05 18:02   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 13/27] qapi: add 'if' to " Marc-André Lureau
2018-12-05 18:29   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 14/27] qapi-event: add 'if' condition to implicit event enum Marc-André Lureau
2018-12-05 18:30   ` Markus Armbruster
2018-12-06 16:02     ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 15/27] qapi: rename allow_dict to allow_implicit Marc-André Lureau
2018-12-05 18:41   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-12-10  8:50       ` Markus Armbruster
2018-12-10 11:15         ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 16/27] qapi: add a dictionary form with 'type' key for members Marc-André Lureau
2018-12-06 15:56   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 17/27] qapi: add 'if' to implicit struct members Marc-André Lureau
2018-12-06 16:11   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 18/27] qapi: add an error in case a discriminator is conditionnal Marc-André Lureau
2018-12-06 16:25   ` Markus Armbruster
2018-12-06 16:26     ` Markus Armbruster
2018-12-10 18:32     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 19/27] qapi: add 'if' on union members Marc-André Lureau
2018-12-06 16:37   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 20/27] qapi: add 'if' to alternate members Marc-André Lureau
2018-12-06 16:41   ` Markus Armbruster
2018-12-08 11:20     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 21/27] qapi: add #if conditions to generated code members Marc-André Lureau
2018-12-06 17:42   ` Markus Armbruster
2018-12-08 11:19     ` Marc-André Lureau
2018-12-10  7:17       ` Markus Armbruster
2018-12-10 10:11         ` Markus Armbruster
2018-12-10 11:17           ` Marc-André Lureau
2018-12-10 18:38           ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 22/27] docs: document schema configuration Marc-André Lureau
2018-12-06 18:14   ` Markus Armbruster
2018-12-08 11:19     ` Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 23/27] qapi: add 'If:' condition to enum values documentation Marc-André Lureau
2018-12-06 18:46   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 24/27] qapi: add 'If:' condition to struct members documentation Marc-André Lureau
2018-12-06 18:47   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 25/27] qapi: add condition to variants documentation Marc-André Lureau
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 26/27] qapi: add more conditions to SPICE Marc-André Lureau
2018-12-06 18:54   ` Markus Armbruster
2018-07-06 10:57 ` [Qemu-devel] [PATCH v6 27/27] qapi: add conditions to REPLICATION type/commands on the schema Marc-André Lureau
2018-12-06 18:55   ` Markus Armbruster
2018-10-02 20:56 ` Marc-André Lureau [this message]
2018-11-08 12:22 ` [Qemu-devel] [PATCH v6 00/27] qapi: add #if pre-processor conditions to generated code (part 2) Marc-André Lureau
2018-12-06 19:13 ` 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=CAJ+F1C+LBKs5RRzLJOZuwOaWUyGyMdUNnGir1u2eJyGybH-Vug@mail.gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=armbru@redhat.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 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.