All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Cc: "BALATON Zoltan" <balaton@eik.bme.hu>,
	"Yonggang Luo" <luoyonggang@gmail.com>,
	qemu-devel@nongnu.org, "Anthony PERARD" <anthony@xenproject.org>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"Philippe Mathieu-Daude" <philmd@mailo.com>,
	"Antony Pavlov" <antonynpavlov@gmail.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>,
	xen-devel@lists.xenproject.org, qemu-riscv@nongnu.org,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	qemu-ppc@nongnu.org, "Alexandre Iooss" <erdnaxe@crans.org>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Clément Chigot" <chigot@adacore.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Yoshinori Sato" <yoshinori.sato@nifty.com>,
	"Frederic Konrad" <konrad.frederic@yahoo.fr>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Chao Liu" <chao.liu@processmission.com>,
	"Sai Pavan Boddu" <sai.pavan.boddu@amd.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Gaurav Sharma" <gaurav.sharma_7@nxp.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	qemu-arm@nongnu.org
Subject: Re: [PATCH 00/15] hw: expand DEFINE_MACHINE to explicit TypeInfo registration
Date: Tue, 3 Nov 2026 08:15:52 +0000	[thread overview]
Message-ID: <aumYOBw-nKQAWdYK@redhat.com> (raw)
In-Reply-To: <aa70e94c-d9a8-41c9-850f-7ded87f7f327@oss.qualcomm.com>

On Fri, Oct 30, 2026 at 05:51:44PM -0800, Pierrick Bouvier wrote:
> On 10/30/2026 4:09 PM, BALATON Zoltan wrote:
> > On Fri, 30 Oct 2026, Yonggang Luo wrote:
> >> DEFINE_MACHINE and DEFINE_MACHINE_EXTENDED hide the TypeInfo and the
> >> type_init
> >> function that calls type_register_static(). A later change needs to
> >> pass a
> > 
> > That's the point of the macro to hide the boiler plate code.
> > 
> >> target mask into that registration, and the macros have no parameter
> >> for it.
> > 
> > Couldn't you just change the macros to take that parameter instead of
> > expanding it everywhere?
> >
> 
> Problem of macros is that they don't have default parameters, so you
> need variants for everything:
> 
> DEFINE_MACHINE
> DEFINE_MACHINE_EXTENDED
> DEFINE_MACHINE_WITH_INTERFACES
> DEFINE_MACHINE_WITH_INTERFACE_ARRAY
> and now would need a new variant, with variant for other existing ones.
> 
> In the end, it's just simpler to remove this and add the boilerplate.
> It's written once and never modified, so using a macro just save typing
> those lines once.

For each machine, it is only written once, but we add machines
over time, and every time a new machine is added the code style
is slightly different. We introduced all the variuos DEFINE_*
macros for QOM to better ensure consistent style and usage as
new code is added over time.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  parent reply	other threads:[~2026-11-03  8:17 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 15:15 [PATCH 00/15] hw: expand DEFINE_MACHINE to explicit TypeInfo registration Yonggang Luo
2026-10-30 15:15 ` [PATCH 01/15] hw/alpha: expand DEFINE_MACHINE in dp264.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 02/15] hw/m68k: expand DEFINE_MACHINE for M68K machines Yonggang Luo
2026-10-30 15:15 ` [PATCH 03/15] hw/microblaze: expand DEFINE_MACHINE for MicroBlaze Yonggang Luo
2026-10-30 15:15 ` [PATCH 04/15] hw/tricore: expand DEFINE_MACHINE in tricore_testboard.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 05/15] hw/arm: expand DEFINE_MACHINE for ARM machines Yonggang Luo
2026-10-30 15:15 ` [PATCH 06/15] hw/riscv: expand DEFINE_MACHINE for RISC-V machines Yonggang Luo
2026-10-30 15:15 ` [PATCH 07/15] hw/core/null-machine: expand DEFINE_MACHINE Yonggang Luo
2026-10-30 15:15 ` [PATCH 08/15] hw/mips: expand DEFINE_MACHINE for MIPS machines Yonggang Luo
2026-10-30 15:15 ` [PATCH 09/15] hw/ppc: expand DEFINE_MACHINE for PowerPC machines Yonggang Luo
2026-10-30 15:15 ` [PATCH 10/15] hw/sh4: expand DEFINE_MACHINE in r2d.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 11/15] hw/sparc: expand DEFINE_MACHINE in leon3.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 12/15] hw/xenpv: expand DEFINE_MACHINE in xen_machine_pv.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 13/15] hw/xtensa: expand DEFINE_MACHINE in sim.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 14/15] hw/xtensa: expand DEFINE_MACHINE in virt.c Yonggang Luo
2026-10-30 15:15 ` [PATCH 15/15] hw/core/boards: remove unused DEFINE_MACHINE* macros Yonggang Luo
2026-10-30 17:49 ` [PATCH 00/15] hw: expand DEFINE_MACHINE to explicit TypeInfo registration Pierrick Bouvier
2026-10-31  0:09 ` BALATON Zoltan
2026-10-31  1:51   ` Pierrick Bouvier
2026-10-31  2:56     ` Yonggang Luo
2026-10-31 12:42     ` BALATON Zoltan
2026-10-31 14:12       ` Yonggang Luo
2026-10-31 17:06         ` BALATON Zoltan
2026-10-31 17:15           ` Yonggang Luo
2026-10-31 23:29             ` BALATON Zoltan
2026-11-01  3:11               ` Yonggang Luo
2026-11-01 20:57                 ` BALATON Zoltan
2026-11-02  3:04                   ` Yonggang Luo
2026-11-02 14:55                     ` BALATON Zoltan
2026-11-02 19:52                       ` Yonggang Luo
2026-11-03 13:13                         ` BALATON Zoltan
2026-11-03 13:26                           ` BALATON Zoltan
2026-11-03 13:54                             ` Yonggang Luo
2026-11-02  3:06                   ` Yonggang Luo
2026-11-01  3:26               ` Yonggang Luo
2026-11-03  8:15     ` Daniel P. Berrangé [this message]
2026-11-03  9:15       ` Yonggang Luo
2026-11-03 13:23         ` BALATON Zoltan
2026-11-03 13:48           ` Yonggang Luo
2026-11-03 13:55             ` Daniel P. Berrangé
2026-11-03 14:17               ` Yonggang Luo
2026-11-03 18:08               ` Yonggang Luo

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=aumYOBw-nKQAWdYK@redhat.com \
    --to=berrange@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=alistair@alistair23.me \
    --cc=anthony@xenproject.org \
    --cc=antonynpavlov@gmail.com \
    --cc=arikalo@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=balaton@eik.bme.hu \
    --cc=balbi@kernel.org \
    --cc=chao.liu@processmission.com \
    --cc=chenhuacai@kernel.org \
    --cc=chigot@adacore.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=erdnaxe@crans.org \
    --cc=gaurav.sharma_7@nxp.com \
    --cc=hpoussin@reactos.org \
    --cc=jcd@tribudubois.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=konrad.frederic@yahoo.fr \
    --cc=liwei1518@gmail.com \
    --cc=luoyonggang@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=nieklinnenbank@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@mailo.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sai.pavan.boddu@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=strahinja.p.jankovic@gmail.com \
    --cc=sundeep.lkml@gmail.com \
    --cc=th.huth+qemu@posteo.eu \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yoshinori.sato@nifty.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 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.