* [PATCH 00/11] hw/arm: Define machines as generic QOM types
@ 2025-04-17 23:58 Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 01/11] hw/core/null-machine: Define machine as generic QOM type Philippe Mathieu-Daudé
` (12 more replies)
0 siblings, 13 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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(-)
--
2.47.1
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 01/11] hw/core/null-machine: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 02/11] hw/arm/bananapi: " Philippe Mathieu-Daudé
` (11 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/core/null-machine.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index a6e477a2d88..1ccaf652eb4 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -42,8 +42,10 @@ static void machine_none_init(MachineState *mch)
}
}
-static void machine_none_machine_init(MachineClass *mc)
+static void null_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "empty machine";
mc->init = machine_none_init;
mc->max_cpus = 1;
@@ -55,4 +57,12 @@ static void machine_none_machine_init(MachineClass *mc)
mc->no_cdrom = 1;
}
-DEFINE_MACHINE("none", machine_none_machine_init)
+static const TypeInfo null_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("none"),
+ .parent = TYPE_MACHINE,
+ .class_init = null_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(null_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 02/11] hw/arm/bananapi: Define machine as generic QOM type
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 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 03/11] hw/arm/cubieboard: " Philippe Mathieu-Daudé
` (10 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/bananapi_m2u.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/arm/bananapi_m2u.c b/hw/arm/bananapi_m2u.c
index b750a575f72..724ee4b05e5 100644
--- a/hw/arm/bananapi_m2u.c
+++ b/hw/arm/bananapi_m2u.c
@@ -125,12 +125,13 @@ static void bpim2u_init(MachineState *machine)
arm_load_kernel(&r40->cpus[0], machine, &bpim2u_binfo);
}
-static void bpim2u_machine_init(MachineClass *mc)
+static void bpim2u_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-a7"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "Bananapi M2U (Cortex-A7)";
mc->init = bpim2u_init;
@@ -144,4 +145,12 @@ static void bpim2u_machine_init(MachineClass *mc)
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("bpim2u", bpim2u_machine_init)
+static const TypeInfo bananapi_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("bpim2u"),
+ .parent = TYPE_MACHINE,
+ .class_init = bpim2u_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(bananapi_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 03/11] hw/arm/cubieboard: Define machine as generic QOM type
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 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 04/11] hw/arm/digic: " Philippe Mathieu-Daudé
` (9 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/cubieboard.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c
index d665d4edd97..36062ac7037 100644
--- a/hw/arm/cubieboard.c
+++ b/hw/arm/cubieboard.c
@@ -106,12 +106,13 @@ static void cubieboard_init(MachineState *machine)
arm_load_kernel(&a10->cpu, machine, &cubieboard_binfo);
}
-static void cubieboard_machine_init(MachineClass *mc)
+static void cubieboard_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-a8"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "cubietech cubieboard (Cortex-A8)";
mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a8");
@@ -125,4 +126,12 @@ static void cubieboard_machine_init(MachineClass *mc)
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("cubieboard", cubieboard_machine_init)
+static const TypeInfo cubieboard_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("cubieboard"),
+ .parent = TYPE_MACHINE,
+ .class_init = cubieboard_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(cubieboard_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 04/11] hw/arm/digic: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 03/11] hw/arm/cubieboard: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 05/11] hw/arm/imx: Define machines as generic QOM types Philippe Mathieu-Daudé
` (8 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/digic_boards.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 466b8b84c0e..3c0cc6e4370 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -136,8 +136,10 @@ static void canon_a1100_init(MachineState *machine)
digic4_board_init(machine, &digic4_board_canon_a1100);
}
-static void canon_a1100_machine_init(MachineClass *mc)
+static void digic_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Canon PowerShot A1100 IS (ARM946)";
mc->init = &canon_a1100_init;
mc->ignore_memory_transaction_failures = true;
@@ -145,4 +147,12 @@ static void canon_a1100_machine_init(MachineClass *mc)
mc->default_ram_id = "ram";
}
-DEFINE_MACHINE("canon-a1100", canon_a1100_machine_init)
+static const TypeInfo digic_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("canon-a1100"),
+ .parent = TYPE_MACHINE,
+ .class_init = digic_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(digic_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 05/11] hw/arm/imx: Define machines as generic QOM types
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 04/11] hw/arm/digic: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type Philippe Mathieu-Daudé
` (7 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/imx25_pdk.c | 14 ++++++++++++--
hw/arm/imx8mp-evk.c | 15 +++++++++++++--
hw/arm/mcimx6ul-evk.c | 15 +++++++++++++--
hw/arm/mcimx7d-sabre.c | 15 +++++++++++++--
hw/arm/sabrelite.c | 14 ++++++++++++--
5 files changed, 63 insertions(+), 10 deletions(-)
diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index e95ea5e4e18..a90def7f1a2 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -141,8 +141,10 @@ static void imx25_pdk_init(MachineState *machine)
}
}
-static void imx25_pdk_machine_init(MachineClass *mc)
+static void imx25_pdk_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "ARM i.MX25 PDK board (ARM926)";
mc->init = imx25_pdk_init;
mc->ignore_memory_transaction_failures = true;
@@ -150,4 +152,12 @@ static void imx25_pdk_machine_init(MachineClass *mc)
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("imx25-pdk", imx25_pdk_machine_init)
+static const TypeInfo imx25_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("imx25-pdk"),
+ .parent = TYPE_MACHINE,
+ .class_init = imx25_pdk_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(imx25_machine_types)
diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
index 967258e6484..c7d87d99230 100644
--- a/hw/arm/imx8mp-evk.c
+++ b/hw/arm/imx8mp-evk.c
@@ -64,11 +64,22 @@ static void imx8mp_evk_init(MachineState *machine)
}
}
-static void imx8mp_evk_machine_init(MachineClass *mc)
+static void imx8mp_evk_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "NXP i.MX 8M Plus EVK Board";
mc->init = imx8mp_evk_init;
mc->max_cpus = FSL_IMX8MP_NUM_CPUS;
mc->default_ram_id = "imx8mp-evk.ram";
}
-DEFINE_MACHINE("imx8mp-evk", imx8mp_evk_machine_init)
+
+static const TypeInfo imx8_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("imx8mp-evk"),
+ .parent = TYPE_MACHINE,
+ .class_init = imx8mp_evk_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(imx8_machine_types)
diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c
index 86982cb0772..d947836d2be 100644
--- a/hw/arm/mcimx6ul-evk.c
+++ b/hw/arm/mcimx6ul-evk.c
@@ -68,12 +68,23 @@ static void mcimx6ul_evk_init(MachineState *machine)
}
}
-static void mcimx6ul_evk_machine_init(MachineClass *mc)
+static void mcimx6ul_evk_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Freescale i.MX6UL Evaluation Kit (Cortex-A7)";
mc->init = mcimx6ul_evk_init;
mc->max_cpus = FSL_IMX6UL_NUM_CPUS;
mc->default_ram_id = "mcimx6ul-evk.ram";
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("mcimx6ul-evk", mcimx6ul_evk_machine_init)
+
+static const TypeInfo imx6_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("mcimx6ul-evk"),
+ .parent = TYPE_MACHINE,
+ .class_init = mcimx6ul_evk_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(imx6_machine_types)
diff --git a/hw/arm/mcimx7d-sabre.c b/hw/arm/mcimx7d-sabre.c
index 33119610113..f5dc9c211dd 100644
--- a/hw/arm/mcimx7d-sabre.c
+++ b/hw/arm/mcimx7d-sabre.c
@@ -68,12 +68,23 @@ static void mcimx7d_sabre_init(MachineState *machine)
}
}
-static void mcimx7d_sabre_machine_init(MachineClass *mc)
+static void mcimx7d_sabre_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Freescale i.MX7 DUAL SABRE (Cortex-A7)";
mc->init = mcimx7d_sabre_init;
mc->max_cpus = FSL_IMX7_NUM_CPUS;
mc->default_ram_id = "mcimx7d-sabre.ram";
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("mcimx7d-sabre", mcimx7d_sabre_machine_init)
+
+static const TypeInfo imx7_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("mcimx7d-sabre"),
+ .parent = TYPE_MACHINE,
+ .class_init = mcimx7d_sabre_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(imx7_machine_types)
diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
index df60d47c6fd..ea59ba301e7 100644
--- a/hw/arm/sabrelite.c
+++ b/hw/arm/sabrelite.c
@@ -103,8 +103,10 @@ static void sabrelite_init(MachineState *machine)
}
}
-static void sabrelite_machine_init(MachineClass *mc)
+static void sabrelite_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Freescale i.MX6 Quad SABRE Lite Board (Cortex-A9)";
mc->init = sabrelite_init;
mc->max_cpus = FSL_IMX6_NUM_CPUS;
@@ -113,4 +115,12 @@ static void sabrelite_machine_init(MachineClass *mc)
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("sabrelite", sabrelite_machine_init)
+static const TypeInfo sabrelite_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("sabrelite"),
+ .parent = TYPE_MACHINE,
+ .class_init = sabrelite_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(sabrelite_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (4 preceding siblings ...)
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 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 07/11] hw/arm/kzm: " Philippe Mathieu-Daudé
` (6 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/integratorcp.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index ac0c6c60961..f95916b517d 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -681,8 +681,10 @@ static void integratorcp_init(MachineState *machine)
arm_load_kernel(cpu, machine, &integrator_binfo);
}
-static void integratorcp_machine_init(MachineClass *mc)
+static void integratorcp_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "ARM Integrator/CP (ARM926EJ-S)";
mc->init = integratorcp_init;
mc->ignore_memory_transaction_failures = true;
@@ -693,8 +695,6 @@ static void integratorcp_machine_init(MachineClass *mc)
machine_add_audiodev_property(mc);
}
-DEFINE_MACHINE("integratorcp", integratorcp_machine_init)
-
static const Property core_properties[] = {
DEFINE_PROP_UINT32("memsz", IntegratorCMState, memsz, 0),
};
@@ -754,3 +754,13 @@ static void integratorcp_register_types(void)
}
type_init(integratorcp_register_types)
+
+static const TypeInfo integratorcp_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("integratorcp"),
+ .parent = TYPE_MACHINE,
+ .class_init = integratorcp_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(integratorcp_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 07/11] hw/arm/kzm: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (5 preceding siblings ...)
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é
2025-04-17 23:58 ` [PATCH 08/11] hw/arm/msf2: " Philippe Mathieu-Daudé
` (5 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 08/11] hw/arm/msf2: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 07/11] hw/arm/kzm: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 09/11] hw/arm/musicpal: " Philippe Mathieu-Daudé
` (4 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/msf2-som.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c
index 29c76c68605..6ce47eaa27a 100644
--- a/hw/arm/msf2-som.c
+++ b/hw/arm/msf2-som.c
@@ -96,16 +96,25 @@ static void emcraft_sf2_s2s010_init(MachineState *machine)
0, soc->envm_size);
}
-static void emcraft_sf2_machine_init(MachineClass *mc)
+static void emcraft_sf2_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-m3"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "SmartFusion2 SOM kit from Emcraft (M2S010)";
mc->init = emcraft_sf2_s2s010_init;
mc->valid_cpu_types = valid_cpu_types;
}
-DEFINE_MACHINE("emcraft-sf2", emcraft_sf2_machine_init)
+static const TypeInfo msf2_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("emcraft-sf2"),
+ .parent = TYPE_MACHINE,
+ .class_init = emcraft_sf2_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(msf2_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 09/11] hw/arm/musicpal: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 08/11] hw/arm/msf2: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 10/11] hw/arm/orangepi: " Philippe Mathieu-Daudé
` (3 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/musicpal.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 48a32c24079..f7c488cd1d6 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -1334,8 +1334,10 @@ static void musicpal_init(MachineState *machine)
arm_load_kernel(cpu, machine, &musicpal_binfo);
}
-static void musicpal_machine_init(MachineClass *mc)
+static void musicpal_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)";
mc->init = musicpal_init;
mc->ignore_memory_transaction_failures = true;
@@ -1346,8 +1348,6 @@ static void musicpal_machine_init(MachineClass *mc)
machine_add_audiodev_property(mc);
}
-DEFINE_MACHINE("musicpal", musicpal_machine_init)
-
static void mv88w8618_wlan_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -1375,3 +1375,13 @@ static void musicpal_register_types(void)
}
type_init(musicpal_register_types)
+
+static const TypeInfo musicpal_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("musicpal"),
+ .parent = TYPE_MACHINE,
+ .class_init = musicpal_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(musicpal_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 10/11] hw/arm/orangepi: Define machine as generic QOM type
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 09/11] hw/arm/musicpal: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-17 23:58 ` [PATCH 11/11] hw/arm/stm32: Define machines as generic QOM types Philippe Mathieu-Daudé
` (2 subsequent siblings)
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/orangepi.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c
index e0956880d11..6821033bfd7 100644
--- a/hw/arm/orangepi.c
+++ b/hw/arm/orangepi.c
@@ -103,12 +103,13 @@ static void orangepi_init(MachineState *machine)
arm_load_kernel(&h3->cpus[0], machine, &orangepi_binfo);
}
-static void orangepi_machine_init(MachineClass *mc)
+static void orangepi_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-a7"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "Orange Pi PC (Cortex-A7)";
mc->init = orangepi_init;
@@ -124,4 +125,12 @@ static void orangepi_machine_init(MachineClass *mc)
mc->auto_create_sdcard = true;
}
-DEFINE_MACHINE("orangepi-pc", orangepi_machine_init)
+static const TypeInfo orangepi_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("orangepi-pc"),
+ .parent = TYPE_MACHINE,
+ .class_init = orangepi_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(orangepi_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH 11/11] hw/arm/stm32: Define machines as generic QOM types
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2025-04-17 23:58 ` [PATCH 10/11] hw/arm/orangepi: " Philippe Mathieu-Daudé
@ 2025-04-17 23:58 ` Philippe Mathieu-Daudé
2025-04-18 2:53 ` [PATCH 00/11] hw/arm: " Pierrick Bouvier
2025-04-18 8:53 ` BALATON Zoltan
12 siblings, 0 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-17 23:58 UTC (permalink / raw)
To: qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Philippe Mathieu-Daudé, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
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/netduino2.c | 13 +++++++++++--
hw/arm/netduinoplus2.c | 13 +++++++++++--
hw/arm/olimex-stm32-h405.c | 13 +++++++++++--
hw/arm/stm32vldiscovery.c | 13 +++++++++++--
4 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c
index df793c77fe1..52c30055d44 100644
--- a/hw/arm/netduino2.c
+++ b/hw/arm/netduino2.c
@@ -52,12 +52,13 @@ static void netduino2_init(MachineState *machine)
0, FLASH_SIZE);
}
-static void netduino2_machine_init(MachineClass *mc)
+static void netduino2_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-m3"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "Netduino 2 Machine (Cortex-M3)";
mc->init = netduino2_init;
@@ -65,4 +66,12 @@ static void netduino2_machine_init(MachineClass *mc)
mc->ignore_memory_transaction_failures = true;
}
-DEFINE_MACHINE("netduino2", netduino2_machine_init)
+static const TypeInfo netduino_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("netduino2"),
+ .parent = TYPE_MACHINE,
+ .class_init = netduino2_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(netduino_machine_types)
diff --git a/hw/arm/netduinoplus2.c b/hw/arm/netduinoplus2.c
index 81b6334cf72..2735d3a0e2b 100644
--- a/hw/arm/netduinoplus2.c
+++ b/hw/arm/netduinoplus2.c
@@ -53,16 +53,25 @@ static void netduinoplus2_init(MachineState *machine)
0, FLASH_SIZE);
}
-static void netduinoplus2_machine_init(MachineClass *mc)
+static void netduinoplus2_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-m4"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "Netduino Plus 2 Machine (Cortex-M4)";
mc->init = netduinoplus2_init;
mc->valid_cpu_types = valid_cpu_types;
}
-DEFINE_MACHINE("netduinoplus2", netduinoplus2_machine_init)
+static const TypeInfo netduino_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("netduinoplus2"),
+ .parent = TYPE_MACHINE,
+ .class_init = netduinoplus2_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(netduino_machine_types)
diff --git a/hw/arm/olimex-stm32-h405.c b/hw/arm/olimex-stm32-h405.c
index 1f15620f9fd..795218c93cf 100644
--- a/hw/arm/olimex-stm32-h405.c
+++ b/hw/arm/olimex-stm32-h405.c
@@ -56,12 +56,13 @@ static void olimex_stm32_h405_init(MachineState *machine)
0, FLASH_SIZE);
}
-static void olimex_stm32_h405_machine_init(MachineClass *mc)
+static void olimex_stm32_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-m4"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "Olimex STM32-H405 (Cortex-M4)";
mc->init = olimex_stm32_h405_init;
@@ -71,4 +72,12 @@ static void olimex_stm32_h405_machine_init(MachineClass *mc)
mc->default_ram_size = 0;
}
-DEFINE_MACHINE("olimex-stm32-h405", olimex_stm32_h405_machine_init)
+static const TypeInfo olimex_stm32_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("olimex-stm32-h405"),
+ .parent = TYPE_MACHINE,
+ .class_init = olimex_stm32_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(olimex_stm32_machine_types)
diff --git a/hw/arm/stm32vldiscovery.c b/hw/arm/stm32vldiscovery.c
index e6c1f5b8d7d..3a9728ca719 100644
--- a/hw/arm/stm32vldiscovery.c
+++ b/hw/arm/stm32vldiscovery.c
@@ -56,16 +56,25 @@ static void stm32vldiscovery_init(MachineState *machine)
0, FLASH_SIZE);
}
-static void stm32vldiscovery_machine_init(MachineClass *mc)
+static void stm32vldiscovery_machine_class_init(ObjectClass *oc, void *data)
{
static const char * const valid_cpu_types[] = {
ARM_CPU_TYPE_NAME("cortex-m3"),
NULL
};
+ MachineClass *mc = MACHINE_CLASS(oc);
mc->desc = "ST STM32VLDISCOVERY (Cortex-M3)";
mc->init = stm32vldiscovery_init;
mc->valid_cpu_types = valid_cpu_types;
}
-DEFINE_MACHINE("stm32vldiscovery", stm32vldiscovery_machine_init)
+static const TypeInfo stm32vldiscovery_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("stm32vldiscovery"),
+ .parent = TYPE_MACHINE,
+ .class_init = stm32vldiscovery_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(stm32vldiscovery_machine_types)
--
2.47.1
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (10 preceding siblings ...)
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 ` Pierrick Bouvier
2025-04-18 8:53 ` BALATON Zoltan
12 siblings, 0 replies; 22+ messages in thread
From: Pierrick Bouvier @ 2025-04-18 2:53 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Andrey Smirnov, Antony Pavlov, Zhao Liu, Beniamino Galvani,
Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
On 4/17/25 16:58, 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(-)
>
Sounds good, for the whole series:
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-17 23:58 [PATCH 00/11] hw/arm: Define machines as generic QOM types Philippe Mathieu-Daudé
` (11 preceding siblings ...)
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
12 siblings, 1 reply; 22+ messages in thread
From: BALATON Zoltan @ 2025-04-18 8:53 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Pierrick Bouvier, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]
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?
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 8:53 ` BALATON Zoltan
@ 2025-04-18 16:33 ` Pierrick Bouvier
2025-04-18 16:59 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 22+ messages in thread
From: Pierrick Bouvier @ 2025-04-18 16:33 UTC (permalink / raw)
To: BALATON Zoltan, Philippe Mathieu-Daudé
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
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?
> Regards,
> BALATON Zoltan
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
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 18:48 ` BALATON Zoltan
0 siblings, 2 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-18 16:59 UTC (permalink / raw)
To: Pierrick Bouvier, BALATON Zoltan
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
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 want to eventually use declarative file to structure most of the
machine boiler plate code. Maybe being momentarily verbose is
acceptable...
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
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 18:48 ` BALATON Zoltan
1 sibling, 1 reply; 22+ messages in thread
From: Pierrick Bouvier @ 2025-04-18 17:03 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, BALATON Zoltan
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
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.
> We want to eventually use declarative file to structure most of the
> machine boiler plate code. Maybe being momentarily verbose is
> acceptable...
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 17:03 ` Pierrick Bouvier
@ 2025-04-18 17:07 ` Philippe Mathieu-Daudé
2025-04-18 17:25 ` Pierrick Bouvier
0 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-04-18 17:07 UTC (permalink / raw)
To: Pierrick Bouvier, BALATON Zoltan
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
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.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 17:07 ` Philippe Mathieu-Daudé
@ 2025-04-18 17:25 ` Pierrick Bouvier
2025-04-18 18:56 ` BALATON Zoltan
0 siblings, 1 reply; 22+ messages in thread
From: Pierrick Bouvier @ 2025-04-18 17:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, BALATON Zoltan
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
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
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 16:59 ` Philippe Mathieu-Daudé
2025-04-18 17:03 ` Pierrick Bouvier
@ 2025-04-18 18:48 ` BALATON Zoltan
2025-04-19 1:20 ` Pierrick Bouvier
1 sibling, 1 reply; 22+ messages in thread
From: BALATON Zoltan @ 2025-04-18 18:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Pierrick Bouvier, qemu-devel, Andrey Smirnov, Antony Pavlov,
Zhao Liu, Beniamino Galvani, Eduardo Habkost, Niek Linnenbank,
qemu-arm, Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
[-- Attachment #1: Type: text/plain, Size: 3413 bytes --]
On Fri, 18 Apr 2025, 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 want to eventually use declarative file to structure most of the
> machine boiler plate code. Maybe being momentarily verbose is
> acceptable...
Moments in QEMU can last years... I was thinking about similar to
OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES. Would something like that be
possible for DEFINE_MACHINE too?
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 17:25 ` Pierrick Bouvier
@ 2025-04-18 18:56 ` BALATON Zoltan
0 siblings, 0 replies; 22+ messages in thread
From: BALATON Zoltan @ 2025-04-18 18:56 UTC (permalink / raw)
To: Pierrick Bouvier
Cc: Philippe Mathieu-Daudé, qemu-devel, Andrey Smirnov,
Antony Pavlov, Zhao Liu, Beniamino Galvani, Eduardo Habkost,
Niek Linnenbank, qemu-arm, Jean-Christophe Dubois, Felipe Balbi,
Bernhard Beschow, Strahinja Jankovic, Jan Kiszka,
Alistair Francis, Subbaraya Sundeep, Alexandre Iooss,
Peter Maydell, Marcel Apfelbaum, Yanan Wang
[-- Attachment #1: Type: text/plain, Size: 4611 bytes --]
On Fri, 18 Apr 2025, Pierrick Bouvier wrote:
> 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?
See commit f84203a8c22 and if I remember correctly there was some
discussion around that on the list where this came from which was partly
started by me being annoyed to have half of a device model consiting of
just boiler plate. I would not like that to come back if can be avoided as
having these macros make the models much more comprehensive for new people
not having to go through all the QOM boiler plate to see the actual
functionality.
Regards,
BALATON Zoltan
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types
2025-04-18 18:48 ` BALATON Zoltan
@ 2025-04-19 1:20 ` Pierrick Bouvier
0 siblings, 0 replies; 22+ messages in thread
From: Pierrick Bouvier @ 2025-04-19 1:20 UTC (permalink / raw)
To: BALATON Zoltan, Philippe Mathieu-Daudé
Cc: qemu-devel, Andrey Smirnov, Antony Pavlov, Zhao Liu,
Beniamino Galvani, Eduardo Habkost, Niek Linnenbank, qemu-arm,
Jean-Christophe Dubois, Felipe Balbi, Bernhard Beschow,
Strahinja Jankovic, Jan Kiszka, Alistair Francis,
Subbaraya Sundeep, Alexandre Iooss, Peter Maydell,
Marcel Apfelbaum, Yanan Wang
On 4/18/25 11:48, BALATON Zoltan wrote:
> On Fri, 18 Apr 2025, 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 want to eventually use declarative file to structure most of the
>> machine boiler plate code. Maybe being momentarily verbose is
>> acceptable...
>
> Moments in QEMU can last years... I was thinking about similar to
> OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES. Would something like that be
> possible for DEFINE_MACHINE too?
>
We can just add the list of interfaces the machine is implementing as an
additional parameter to DEFINE_MACHINE, and this solves the problem
without adding any boilerplate.
Ultimately, we'll need to tag all machines to mention targets supported,
so this information has to be written somewhere.
> Regards,
> BALATON Zoltan
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2025-04-19 1:20 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-04-18 18:56 ` BALATON Zoltan
2025-04-18 18:48 ` BALATON Zoltan
2025-04-19 1:20 ` Pierrick Bouvier
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).