qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Andrey Smirnov" <andrew.smirnov@gmail.com>,
	"Antony Pavlov" <antonynpavlov@gmail.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"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>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"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: [PATCH 07/11] hw/arm/kzm: Define machine as generic QOM type
Date: Fri, 18 Apr 2025 01:58:10 +0200	[thread overview]
Message-ID: <20250417235814.98677-8-philmd@linaro.org> (raw)
In-Reply-To: <20250417235814.98677-1-philmd@linaro.org>

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.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/arm/kzm.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 362c1454099..b56cabe9f94 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -131,12 +131,22 @@ static void kzm_init(MachineState *machine)
     }
 }
 
-static void kzm_machine_init(MachineClass *mc)
+static void kzm_machine_class_init(ObjectClass *oc, void *data)
 {
+    MachineClass *mc = MACHINE_CLASS(oc);
+
     mc->desc = "ARM KZM Emulation Baseboard (ARM1136)";
     mc->init = kzm_init;
     mc->ignore_memory_transaction_failures = true;
     mc->default_ram_id = "kzm.ram";
 }
 
-DEFINE_MACHINE("kzm", kzm_machine_init)
+static const TypeInfo kzm_machine_types[] = {
+    {
+        .name           = MACHINE_TYPE_NAME("kzm"),
+        .parent         = TYPE_MACHINE,
+        .class_init     = kzm_machine_class_init,
+    },
+};
+
+DEFINE_TYPES(kzm_machine_types)
-- 
2.47.1



  parent reply	other threads:[~2025-04-18  0:01 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 ` Philippe Mathieu-Daudé [this message]
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
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=20250417235814.98677-8-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=andrew.smirnov@gmail.com \
    --cc=antonynpavlov@gmail.com \
    --cc=b.galvani@gmail.com \
    --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=pierrick.bouvier@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).