[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/3] qapi/machine-target: refactor machine-target
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v2 1/3] qapi/machine-target: refactor machine-target |
|
Date: |
Thu, 11 May 2023 16:38:28 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
First of all, my sincere apologies for the delayed review.
The patch series needs a rebase. But let me review it first.
Dinah Baum <dinahbaum123@gmail.com> writes:
> Moved architecture agnostic data types to their own
> file to avoid "attempt to use poisoned TARGET_*"
> error that results when including qapi header
> with commands that aren't defined for all architectures.
> Required to implement enabling `query-cpu-model-expansion`
> on all architectures
>
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> MAINTAINERS | 1 +
> qapi/machine-target-common.json | 79 +++++++++++++++++++++++++++++++++
> qapi/machine-target.json | 73 +-----------------------------
> qapi/meson.build | 1 +
> 4 files changed, 82 insertions(+), 72 deletions(-)
> create mode 100644 qapi/machine-target-common.json
Do we really want to create qapi/machine-target-common.json? Before we
can answer this, I think I should explain how we use QAPI modules so
far.
You already know about target-independent vs. target-dependent code.
In target-dependent code, a multitude of additional macros are
available, such as TARGET_S390X, TARGET_I386, TARGET_ARM, ... We poison
them to prevent accidental use in target-independent code.
Since target-dependent code needs to be compiled per target, we try to
keep as much code as we can target-independent.
QAPI-generated code is target-independent except for code generated for
QAPI modules whose name ends with "-target". Yes, that's a bit of a
hack. See qapi/meson.build.
When a subsystem needs QAPI schema stuff, we generally put it into its
own module. For instance, the PCI subsystem's QAPI schema is in the pci
module (qapi/pci.json). See MAINTAINERS for more.
Most subsystems' QAPI schema is entirely target-independent. If a
subsystem needs some target-dependence in its schema, we split the QAPI
module into a target-dependent and a target-independent part. We have
two such pairs: misc and misc-target, machine and machine-target.
Can we stick to this convention? I.e. move to existing machine.json
instead to new machine-target-common.json. Let's have a closer look.
This patch moves a few types from (machine-dependent)
machine-target.json to new (and machine-independent)
machine-target-common.json.
The next patch moves another type and a command after removing their
machine-dependence.
After both moves, machine-target.json needs to include
machine-target-common.json for CpuModelInfo and CpuModelCompareResult.
Aside: the latter is only ever used in machine-target.json. We could
keep it there.
If we move to machine.json instead, then machine-target.json needs to
include that.
Would that work?
If not: I think the name machine-target-common.json is unfortunate,
because it kind of suggests machine-dependence.
[...]
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 1/3] qapi/machine-target: refactor machine-target,
Markus Armbruster <=