From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"BALATON Zoltan" <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, Andrey Smirnov <andrew.smirnov@gmail.com>,
Antony Pavlov <antonynpavlov@gmail.com>,
Zhao Liu <zhao1.liu@intel.com>,
Beniamino Galvani <b.galvani@gmail.com>,
Eduardo Habkost <eduardo@habkost.net>,
Niek Linnenbank <nieklinnenbank@gmail.com>,
qemu-arm@nongnu.org, Jean-Christophe Dubois <jcd@tribudubois.net>,
Felipe Balbi <balbi@kernel.org>,
Bernhard Beschow <shentey@gmail.com>,
Strahinja Jankovic <strahinja.p.jankovic@gmail.com>,
Jan Kiszka <jan.kiszka@web.de>,
Alistair Francis <alistair@alistair23.me>,
Subbaraya Sundeep <sundeep.lkml@gmail.com>,
Alexandre Iooss <erdnaxe@crans.org>,
Peter Maydell <peter.maydell@linaro.org>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Yanan Wang <wangyanan55@huawei.com>
Subject: Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
Date: Fri, 18 Apr 2025 10:25:01 -0700 [thread overview]
Message-ID: <a0d9ed9a-7b97-43a5-a380-0bb607163661@linaro.org> (raw)
In-Reply-To: <ee3c9b11-4c4e-41c7-8029-7e5c153215d7@linaro.org>
On 4/18/25 10:07, Philippe Mathieu-Daudé wrote:
> On 18/4/25 19:03, Pierrick Bouvier wrote:
>> On 4/18/25 09:59, Philippe Mathieu-Daudé wrote:
>>> On 18/4/25 18:33, Pierrick Bouvier wrote:
>>>> On 4/18/25 01:53, BALATON Zoltan wrote:
>>>>> On Fri, 18 Apr 2025, Philippe Mathieu-Daudé wrote:
>>>>>> While DEFINE_MACHINE() is a succinct macro, it doesn't
>>>>>> allow registering QOM interfaces to the defined machine.
>>>>>> Convert to the generic DEFINE_TYPES() in preparation to
>>>>>> register interfaces.
>>>>>>
>>>>>> Philippe Mathieu-Daudé (11):
>>>>>> hw/core/null-machine: Define machine as generic QOM type
>>>>>> hw/arm/bananapi: Define machine as generic QOM type
>>>>>> hw/arm/cubieboard: Define machine as generic QOM type
>>>>>> hw/arm/digic: Define machine as generic QOM type
>>>>>> hw/arm/imx: Define machines as generic QOM types
>>>>>> hw/arm/integratorcp: Define machine as generic QOM type
>>>>>> hw/arm/kzm: Define machine as generic QOM type
>>>>>> hw/arm/msf2: Define machine as generic QOM type
>>>>>> hw/arm/musicpal: Define machine as generic QOM type
>>>>>> hw/arm/orangepi: Define machine as generic QOM type
>>>>>> hw/arm/stm32: Define machines as generic QOM types
>>>>>>
>>>>>> hw/arm/bananapi_m2u.c | 13 +++++++++++--
>>>>>> hw/arm/cubieboard.c | 13 +++++++++++--
>>>>>> hw/arm/digic_boards.c | 14 ++++++++++++--
>>>>>> hw/arm/imx25_pdk.c | 14 ++++++++++++--
>>>>>> hw/arm/imx8mp-evk.c | 15 +++++++++++++--
>>>>>> hw/arm/integratorcp.c | 16 +++++++++++++---
>>>>>> hw/arm/kzm.c | 14 ++++++++++++--
>>>>>> hw/arm/mcimx6ul-evk.c | 15 +++++++++++++--
>>>>>> hw/arm/mcimx7d-sabre.c | 15 +++++++++++++--
>>>>>> hw/arm/msf2-som.c | 13 +++++++++++--
>>>>>> hw/arm/musicpal.c | 16 +++++++++++++---
>>>>>> hw/arm/netduino2.c | 13 +++++++++++--
>>>>>> hw/arm/netduinoplus2.c | 13 +++++++++++--
>>>>>> hw/arm/olimex-stm32-h405.c | 13 +++++++++++--
>>>>>> hw/arm/orangepi.c | 13 +++++++++++--
>>>>>> hw/arm/sabrelite.c | 14 ++++++++++++--
>>>>>> hw/arm/stm32vldiscovery.c | 13 +++++++++++--
>>>>>> hw/core/null-machine.c | 14 ++++++++++++--
>>>>>> 18 files changed, 213 insertions(+), 38 deletions(-)
>>>>>
>>>>> This is much longer and exposing boiler plate code. Is it possible
>>>>> instead
>>>>> to change DEFINE_MACHINE or add another similar macro that allows
>>>>> specifying more details such as class state type and interfaces like we
>>>>> already have for OBJECT_DEFINE macros to keep the boiler plate code
>>>>> hidden
>>>>> and not bring it back?
>>>>>
>>>>
>>>> We can eventually modify DEFINE_MACHINES, to take an additional
>>>> interfaces parameter, and replace all call sites, with an empty list for
>>>> all boards out of hw/arm.
>>>>
>>>> As long as we avoid something like:
>>>> DEFINE_MACHINES_WITH_INTERFACE_1(...)
>>>> DEFINE_MACHINES_WITH_INTERFACE_2(...)
>>>> DEFINE_MACHINES_WITH_INTERFACE_3(...)
>>>> I'm ok with keeping the macro.
>>>>
>>>> Would that work for you folks?
>>>
>>> But then we'll want DEFINE_PPC32_MACHINE() ->
>>> DEFINE_MACHINES_WITH_INTERFACE_1() etc...
>>>
>>
>> We can see that later when touching other targets. For now,
>> DEFINE_MACHINE is not used in a lot of places, so replacing call sites
>> should be easy, and it will cover hw/arm, which is our point of interest
>> now.
>
> I concur and share the same goal, but here Zoltan is concerned about
> converting DEFINE_MACHINE to DEFINE_TYPES adds 12 lines of boilerplate
> code.
If I understand correctly, Zoltan issue is that we remove usage of
DEFINE_MACHINE, and put boilerplate for type definition instead.
So hiding boilerplate behind the macro would be ok, thus my proposal.
Zoltan, could you please confirm in which way you were qualifying this
as boilerplate?
Thanks,
Pierrick
next prev parent reply other threads:[~2025-04-18 17:25 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 01/11] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 02/11] hw/arm/bananapi: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 03/11] hw/arm/cubieboard: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 04/11] hw/arm/digic: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 05/11] hw/arm/imx: Define machines as generic QOM types Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 07/11] hw/arm/kzm: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 08/11] hw/arm/msf2: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 09/11] hw/arm/musicpal: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 10/11] hw/arm/orangepi: " Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 11/11] hw/arm/stm32: Define machines as generic QOM types Philippe Mathieu-Daudé
2025-04-18 2:53 ` [PATCH 00/11] hw/arm: " Pierrick Bouvier
2025-04-18 8:53 ` BALATON Zoltan
2025-04-18 16:33 ` Pierrick Bouvier
2025-04-18 16:59 ` Philippe Mathieu-Daudé
2025-04-18 17:03 ` Pierrick Bouvier
2025-04-18 17:07 ` Philippe Mathieu-Daudé
2025-04-18 17:25 ` Pierrick Bouvier [this message]
2025-04-18 18:56 ` BALATON Zoltan
2025-04-18 18:48 ` BALATON Zoltan
2025-04-19 1:20 ` Pierrick Bouvier
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=a0d9ed9a-7b97-43a5-a380-0bb607163661@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=alistair@alistair23.me \
--cc=andrew.smirnov@gmail.com \
--cc=antonynpavlov@gmail.com \
--cc=b.galvani@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=balbi@kernel.org \
--cc=eduardo@habkost.net \
--cc=erdnaxe@crans.org \
--cc=jan.kiszka@web.de \
--cc=jcd@tribudubois.net \
--cc=marcel.apfelbaum@gmail.com \
--cc=nieklinnenbank@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
--cc=strahinja.p.jankovic@gmail.com \
--cc=sundeep.lkml@gmail.com \
--cc=wangyanan55@huawei.com \
--cc=zhao1.liu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).