All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: "Benoît Canet" <benoit.canet@irqsave.net>,
	"Markus Armbruster" <armbru@redhat.com>,
	qemu-devel@nongnu.org, "Luiz Capitulino" <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v12 0/4] qapi: Allow modularization of QAPI schema files
Date: Tue, 6 May 2014 15:07:40 +0200	[thread overview]
Message-ID: <20140506130740.GA17717@irqsave.net> (raw)
In-Reply-To: <20140502135218.31383.90270.stgit@fimbulvetr.bsc.es>

The Friday 02 May 2014 à 15:52:19 (+0200), Lluís Vilanova wrote :

Hello,

I am trying to use this series to modularise the block API.

Here are my finding.

I tried to make a qmp/block.json including VM state related API.
block.json include a qmp/block-core.json containing only true block stuff.

When generating and compiling block-core.json to link it with qemu-nbd
I saw that some of the block stuff needed ErrorClass so I went the route
of creating a qmp/common.json containing ErrorClass.

common.json being included in block-core.json and in qapi-schema.json it
quickly lead some code being generated in double and the compilation to choke.

What do you think would be the best solution to fix this ?
(Fix the generator ? Make include ignore second inclusion of the same file ?)

Best regards

Benoît

> Adds an include primitive to the syntax of QAPI schema files, allowing these to
> be modularized into multiple per-topic files in the future.
> 
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---
> 
> Changes in v12:
> 
> * Fix "Reviewed-by" lines.
> 
> Changes in v11:
> 
> * Rename "tests/include-after-err*" to "tests/include-before-err*" (Markus
>   Armbruster).
> * Do not use too many line breaks in "test/Makefile" (Eric Blake).
> 
> Changes in v10:
> 
> * Various argument/variable name changes (Markus Armbruster).
> * Fix path replacement command in error files when executing tests (Markus
>   Armbruster).
> * Catch IOError and translate it to QAPIExprError (Markus Armbruster).
> 
> Changes in v9:
> 
> * Do not catch unknown exceptions in "tests/qapi-schema/test-qapi.py".
> * Show primitive syntax in commit message.
> * Do not pre-initialize 'input_file' in "scripts/qapi-commands.py".
> * Use a one-liner for test error message checking.
> 
> Changes in v8:
> 
> * Do not show absolute paths in error messages.
> 
> Changes in v7:
> 
> * Add tests for relative path inclusion.
> * Print inclusion path on all errors.
> * Add test to ensure errors after an include have the correct context.
> * Squash "qapi.py" changes and tests into a single patch.
> * Add test for 'include' directive format.
> * s/file path/file name/.
> * s/included/include/.
> * Move "-i" to the end of the command.
> * Fix GNUism when using sed.
> 
> Changes in v6:
> 
> * Split changes for long-line breaking in makefiles.
> * Put documentation on a separate section; reference recursiveness.
> * Check (and test) for non-string include arguments (tanks to Benoît Canet).
> 
> Changes in v5:
> 
> * Rebase on b3706fa.
> * Remove 'error_base' argument in 'parse_schema'; fix test checks instead.
> * Implement include directive using JSON syntax.
> 
> Changes in v4:
> 
> * Rebase on 3e890c7.
> * Minor cosmetic changes.
> * Fix recording of included files in case of a cycle error.
> * Add a more complex include cycle test.
> 
> 
> Changes in v3:
> 
> * Fix documentation examples regarding how the input file is passed to the
>   scripts.
> * Add documentation for the 'include' directive.
> * Detect inclusion loops.
> * Fix "tests/qapi-schema/test-qapi.py" and "tests/Makefile" to use an explicit
>   input file when running tests.
> * Fix QAPI tests to cope with an explicit input file.
> * Add tests for the "include" directive.
> 
> 
> Changes in v2:
> 
> * Change the scripts to use an explicit input file instead of standard input.
> * Fix "tests/Makefile" to use the new argument.
> * Get the input directory for the "include" directive from the input file
>   dirname.
> 
> 
> Lluís Vilanova (4):
>       qapi: [trivial] Break long command lines
>       qapi: [trivial] Do not catch unknown exceptions in "test-qapi.py"
>       qapi: Use an explicit input file
>       qapi: Add a primitive to include other files from a QAPI schema file
> 
> 
>  Makefile                                           |   24 +++++--
>  docs/qapi-code-gen.txt                             |   15 ++++
>  scripts/qapi-commands.py                           |    9 ++-
>  scripts/qapi-types.py                              |    9 ++-
>  scripts/qapi-visit.py                              |    9 ++-
>  scripts/qapi.py                                    |   70 ++++++++++++++++----
>  tests/Makefile                                     |   26 ++++++-
>  tests/qapi-schema/duplicate-key.err                |    2 -
>  .../qapi-schema/flat-union-invalid-branch-key.err  |    2 -
>  .../flat-union-invalid-discriminator.err           |    2 -
>  tests/qapi-schema/flat-union-no-base.err           |    2 -
>  .../flat-union-string-discriminator.err            |    2 -
>  tests/qapi-schema/funny-char.err                   |    2 -
>  tests/qapi-schema/include-before-err.err           |    1 
>  tests/qapi-schema/include-before-err.exit          |    1 
>  tests/qapi-schema/include-before-err.json          |    2 +
>  tests/qapi-schema/include-before-err.out           |    0 
>  tests/qapi-schema/include-cycle-b.json             |    1 
>  tests/qapi-schema/include-cycle-c.json             |    1 
>  tests/qapi-schema/include-cycle.err                |    3 +
>  tests/qapi-schema/include-cycle.exit               |    1 
>  tests/qapi-schema/include-cycle.json               |    1 
>  tests/qapi-schema/include-cycle.out                |    0 
>  tests/qapi-schema/include-format-err.err           |    1 
>  tests/qapi-schema/include-format-err.exit          |    1 
>  tests/qapi-schema/include-format-err.json          |    2 +
>  tests/qapi-schema/include-format-err.out           |    0 
>  tests/qapi-schema/include-nested-err.err           |    2 +
>  tests/qapi-schema/include-nested-err.exit          |    1 
>  tests/qapi-schema/include-nested-err.json          |    1 
>  tests/qapi-schema/include-nested-err.out           |    0 
>  tests/qapi-schema/include-no-file.err              |    1 
>  tests/qapi-schema/include-no-file.exit             |    1 
>  tests/qapi-schema/include-no-file.json             |    1 
>  tests/qapi-schema/include-no-file.out              |    0 
>  tests/qapi-schema/include-non-file.err             |    1 
>  tests/qapi-schema/include-non-file.exit            |    1 
>  tests/qapi-schema/include-non-file.json            |    1 
>  tests/qapi-schema/include-non-file.out             |    0 
>  tests/qapi-schema/include-relpath-sub.json         |    2 +
>  tests/qapi-schema/include-relpath.err              |    0 
>  tests/qapi-schema/include-relpath.exit             |    1 
>  tests/qapi-schema/include-relpath.json             |    1 
>  tests/qapi-schema/include-relpath.out              |    3 +
>  tests/qapi-schema/include-self-cycle.err           |    1 
>  tests/qapi-schema/include-self-cycle.exit          |    1 
>  tests/qapi-schema/include-self-cycle.json          |    1 
>  tests/qapi-schema/include-self-cycle.out           |    0 
>  tests/qapi-schema/include-simple-sub.json          |    2 +
>  tests/qapi-schema/include-simple.err               |    0 
>  tests/qapi-schema/include-simple.exit              |    1 
>  tests/qapi-schema/include-simple.json              |    1 
>  tests/qapi-schema/include-simple.out               |    3 +
>  tests/qapi-schema/include/relpath.json             |    1 
>  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/non-objects.err                  |    2 -
>  tests/qapi-schema/quoted-structural-chars.err      |    2 -
>  tests/qapi-schema/test-qapi.py                     |    6 +-
>  tests/qapi-schema/trailing-comma-list.err          |    2 -
>  tests/qapi-schema/trailing-comma-object.err        |    2 -
>  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-invalid-base.err           |    2 -
>  66 files changed, 187 insertions(+), 58 deletions(-)
>  create mode 100644 tests/qapi-schema/include-before-err.err
>  create mode 100644 tests/qapi-schema/include-before-err.exit
>  create mode 100644 tests/qapi-schema/include-before-err.json
>  create mode 100644 tests/qapi-schema/include-before-err.out
>  create mode 100644 tests/qapi-schema/include-cycle-b.json
>  create mode 100644 tests/qapi-schema/include-cycle-c.json
>  create mode 100644 tests/qapi-schema/include-cycle.err
>  create mode 100644 tests/qapi-schema/include-cycle.exit
>  create mode 100644 tests/qapi-schema/include-cycle.json
>  create mode 100644 tests/qapi-schema/include-cycle.out
>  create mode 100644 tests/qapi-schema/include-format-err.err
>  create mode 100644 tests/qapi-schema/include-format-err.exit
>  create mode 100644 tests/qapi-schema/include-format-err.json
>  create mode 100644 tests/qapi-schema/include-format-err.out
>  create mode 100644 tests/qapi-schema/include-nested-err.err
>  create mode 100644 tests/qapi-schema/include-nested-err.exit
>  create mode 100644 tests/qapi-schema/include-nested-err.json
>  create mode 100644 tests/qapi-schema/include-nested-err.out
>  create mode 100644 tests/qapi-schema/include-no-file.err
>  create mode 100644 tests/qapi-schema/include-no-file.exit
>  create mode 100644 tests/qapi-schema/include-no-file.json
>  create mode 100644 tests/qapi-schema/include-no-file.out
>  create mode 100644 tests/qapi-schema/include-non-file.err
>  create mode 100644 tests/qapi-schema/include-non-file.exit
>  create mode 100644 tests/qapi-schema/include-non-file.json
>  create mode 100644 tests/qapi-schema/include-non-file.out
>  create mode 100644 tests/qapi-schema/include-relpath-sub.json
>  create mode 100644 tests/qapi-schema/include-relpath.err
>  create mode 100644 tests/qapi-schema/include-relpath.exit
>  create mode 100644 tests/qapi-schema/include-relpath.json
>  create mode 100644 tests/qapi-schema/include-relpath.out
>  create mode 100644 tests/qapi-schema/include-self-cycle.err
>  create mode 100644 tests/qapi-schema/include-self-cycle.exit
>  create mode 100644 tests/qapi-schema/include-self-cycle.json
>  create mode 100644 tests/qapi-schema/include-self-cycle.out
>  create mode 100644 tests/qapi-schema/include-simple-sub.json
>  create mode 100644 tests/qapi-schema/include-simple.err
>  create mode 100644 tests/qapi-schema/include-simple.exit
>  create mode 100644 tests/qapi-schema/include-simple.json
>  create mode 100644 tests/qapi-schema/include-simple.out
>  create mode 100644 tests/qapi-schema/include/relpath.json
> 
> 
> To: qemu-devel@nongnu.org
> Cc: Luiz Capitulino <lcapitulino@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Benoît Canet <benoit.canet@irqsave.net>

  parent reply	other threads:[~2014-05-06 13:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 13:52 [Qemu-devel] [PATCH v12 0/4] qapi: Allow modularization of QAPI schema files Lluís Vilanova
2014-05-02 13:52 ` [Qemu-devel] [PATCH v12 1/4] qapi: [trivial] Break long command lines Lluís Vilanova
2014-05-02 13:52 ` [Qemu-devel] [PATCH v12 2/4] qapi: [trivial] Do not catch unknown exceptions in "test-qapi.py" Lluís Vilanova
2014-05-02 13:52 ` [Qemu-devel] [PATCH v12 3/4] qapi: Use an explicit input file Lluís Vilanova
2014-05-02 13:52 ` [Qemu-devel] [PATCH v12 4/4] qapi: Add a primitive to include other files from a QAPI schema file Lluís Vilanova
2014-05-05 20:31   ` Luiz Capitulino
2014-05-05 21:15     ` Lluís Vilanova
2014-05-07 18:46   ` Lluís Vilanova
2014-05-07 18:48     ` Lluís Vilanova
2014-05-07 20:44     ` Luiz Capitulino
2014-05-18 11:44     ` Peter Maydell
2014-05-05 18:21 ` [Qemu-devel] [PATCH v12 0/4] qapi: Allow modularization of QAPI schema files Luiz Capitulino
2014-05-07 16:36   ` Luiz Capitulino
2014-05-07 17:07     ` Lluís Vilanova
2014-05-07 17:14       ` Luiz Capitulino
2014-05-07 17:20         ` Lluís Vilanova
2014-05-07 17:23           ` Luiz Capitulino
2014-05-06 13:07 ` Benoît Canet [this message]
2014-05-06 13:27   ` Luiz Capitulino
2014-05-06 14:05     ` Benoît Canet
2014-05-06 14:55     ` Eric Blake
2014-05-06 16:55       ` Luiz Capitulino
2014-05-06 17:11         ` Eric Blake
2014-05-07 19:44       ` Markus Armbruster
2014-05-07 20:01         ` Benoît Canet
2014-05-06 15:02   ` Eric Blake

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=20140506130740.GA17717@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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.