From: Markus Armbruster <armbru@redhat.com>
To: Dinah Baum <dinahbaum123@gmail.com>
Cc: qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Eric Blake" <eblake@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Michael Roth" <michael.roth@amd.com>
Subject: Re: [PATCH v2 1/3] qapi/machine-target: refactor machine-target
Date: Thu, 11 May 2023 16:38:28 +0200 [thread overview]
Message-ID: <87fs83hr17.fsf@pond.sub.org> (raw)
In-Reply-To: <20230404011956.90375-2-dinahbaum123@gmail.com> (Dinah Baum's message of "Mon, 3 Apr 2023 21:19:54 -0400")
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.
[...]
next prev parent reply other threads:[~2023-05-11 14:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 1:19 [RESEND PATCH v2 0/3] Enable -cpu <cpu>,help Dinah Baum
2023-04-04 1:19 ` [PATCH v2 1/3] qapi/machine-target: refactor machine-target Dinah Baum
2023-05-11 14:38 ` Markus Armbruster [this message]
2023-04-04 1:19 ` [PATCH v2 2/3] cpu, qapi, target/arm, i386, s390x: Generalize query-cpu-model-expansion Dinah Baum
2023-05-11 17:41 ` Markus Armbruster
2023-04-04 1:19 ` [PATCH v2 3/3] cpu, qdict, vl: Enable printing options for CPU type Dinah Baum
2023-05-26 6:07 ` Markus Armbruster
2023-05-11 12:16 ` [RESEND PATCH v2 0/3] Enable -cpu <cpu>,help Peter Maydell
2023-05-11 13:51 ` Markus Armbruster
2023-05-26 14:28 ` Igor Mammedov
2023-05-26 19:47 ` Peter Maydell
-- strict thread matches above, loose matches on Subject: below --
2023-03-14 10:00 [PATCH " Dinah Baum
2023-03-14 10:00 ` [PATCH v2 1/3] qapi/machine-target: refactor machine-target Dinah Baum
2023-03-14 10:29 ` Philippe Mathieu-Daudé
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=87fs83hr17.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dinahbaum123@gmail.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wangyanan55@huawei.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.