[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 00/13] qapi: add #if pre-processor conditions to
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 00/13] qapi: add #if pre-processor conditions to generated code (part 3) |
Date: |
Tue, 18 Dec 2018 19:19:16 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Marc-André Lureau <address@hidden> writes:
> Hi,
>
> The thrid and last part (of "[PATCH v2 00/54] qapi: add #if
> pre-processor conditions to generated code") is about adding schema
> conditions based on the target.
>
> For now, the qapi code is compiled in common objects (common to all
> targets). This makes it impossible to add #if TARGET_ARM for example.
>
> The patch "RFC: qapi: learn to split the schema by 'top-unit'"
> proposes to split the schema by "top-unit", so that generated code can
> be built either in common objects or per-target. That patch is a bit
> rough, I would like to get some feedback about the approach before
> trying to improve it. The following patches demonstrate usage of
> target-based #if conditions, and getting rid of the
> qmp_unregister_command() hack.
Lovely except for the 'top-unit' feature. I believe the existing
modules can do the job. Quoting my "[PATCH v2 00/29] Modularize
generated QAPI code":
Related: Marc-André's 'unit' pragma proposal. That's a different
way to split off parts of the generated code, motivated by the
desire to use poisoned identifiers such as TARGET_I386. I noted in
my review of v3 that I "can either accept it, or come up with a
better solution." This is my attempt at a better solution. It's a
bit more ambitious, and thus more useful (I hope). The pragma has
one theoretical advantage, though: you can modularize the generated
output in different ways than the input. The patches using don't do
that, however.
I'm going to post RFC patches that show how to do a target-dependent
module. Then we can discuss the two approaches.
- [Qemu-devel] [PATCH 07/13] qapi: make s390 commands depend on TARGET_S390X, (continued)
- [Qemu-devel] [PATCH 07/13] qapi: make s390 commands depend on TARGET_S390X, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 08/13] target.json: add a note about query-cpu* not being s390x-specific, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 09/13] qapi: make query-gic-capabilities depend on TARGET_ARM, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 10/13] qapi: make query-cpu-model-expansion depend on s390 or x86, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 11/13] qapi: make query-cpu-definitions depend on specific targets, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 12/13] qapi: remove qmp_unregister_command(), Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 13/13] qapi: move RTC_CHANGE to the target schema, Marc-André Lureau, 2018/12/16
- Re: [Qemu-devel] [PATCH 00/13] qapi: add #if pre-processor conditions to generated code (part 3),
Markus Armbruster <=