From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Evgeny Voevodin" <e.voevodin@samsung.com>,
"Rob Herring" <robh@kernel.org>,
"Igor Mitsyanko" <i.mitsyanko@gmail.com>,
"Leon Alrae" <leon.alrae@imgtec.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Alexander Graf" <agraf@suse.de>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Michael Walle" <michael@walle.cc>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Dmitry Solodkiy" <d.solodkiy@samsung.com>,
"open list:405" <qemu-ppc@nongnu.org>,
"Maksim Kozlov" <m.kozlov@samsung.com>,
"Andreas Färber" <afaerber@suse.de>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 1/6] Use type_init() for all machine QOM types
Date: Sat, 19 Sep 2015 17:36:38 +0200 [thread overview]
Message-ID: <1442677004-4482-2-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1442677004-4482-1-git-send-email-afaerber@suse.de>
This prepares for dropping machine_init(), now that QEMUMachine is gone.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/arm/exynos4_boards.c | 2 +-
hw/arm/gumstix.c | 2 +-
hw/arm/highbank.c | 2 +-
hw/arm/nseries.c | 2 +-
hw/arm/omap_sx1.c | 2 +-
hw/arm/realview.c | 2 +-
hw/arm/spitz.c | 15 +++++----------
hw/arm/stellaris.c | 11 +++--------
hw/arm/versatilepb.c | 11 +++--------
hw/arm/vexpress.c | 2 +-
hw/arm/virt.c | 2 +-
hw/lm32/lm32_boards.c | 2 +-
hw/mips/mips_jazz.c | 2 +-
hw/ppc/ppc405_boards.c | 2 +-
hw/sparc/sun4m.c | 14 +++++---------
hw/sparc64/sun4u.c | 12 ++++--------
hw/xtensa/xtfpga.c | 2 +-
include/hw/boards.h | 2 +-
include/hw/i386/pc.h | 2 +-
19 files changed, 34 insertions(+), 57 deletions(-)
diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index da82b27..336c8b2 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -180,4 +180,4 @@ static void exynos4_machines_init(void)
type_register_static(&smdkc210_type);
}
-machine_init(exynos4_machines_init)
+type_init(exynos4_machines_init)
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index 32ad041..9b5938b 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -155,4 +155,4 @@ static void gumstix_machine_init(void)
type_register_static(&verdex_type);
}
-machine_init(gumstix_machine_init)
+type_init(gumstix_machine_init)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index be04b27..98825e7 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -429,4 +429,4 @@ static void calxeda_machines_init(void)
type_register_static(&midway_type);
}
-machine_init(calxeda_machines_init)
+type_init(calxeda_machines_init)
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 6a6b3e6..2bfdc20 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -1449,4 +1449,4 @@ static void nseries_machine_init(void)
type_register_static(&n810_type);
}
-machine_init(nseries_machine_init)
+type_init(nseries_machine_init)
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 8eaf8f3..98c4066 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -251,4 +251,4 @@ static void sx1_machine_init(void)
type_register_static(&sx1_machine_v2_type);
}
-machine_init(sx1_machine_init)
+type_init(sx1_machine_init)
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index e14828d..c14aab2 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -468,4 +468,4 @@ static void realview_machine_init(void)
type_register_static(&realview_pbx_a9_type);
}
-machine_init(realview_machine_init)
+type_init(realview_machine_init)
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 2af03be..8aa0172 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -1028,16 +1028,6 @@ static const TypeInfo terrierpda_type = {
.class_init = terrierpda_class_init,
};
-static void spitz_machine_init(void)
-{
- type_register_static(&akitapda_type);
- type_register_static(&spitzpda_type);
- type_register_static(&borzoipda_type);
- type_register_static(&terrierpda_type);
-}
-
-machine_init(spitz_machine_init)
-
static bool is_version_0(void *opaque, int version_id)
{
return version_id == 0;
@@ -1167,6 +1157,11 @@ static const TypeInfo spitz_lcdtg_info = {
static void spitz_register_types(void)
{
+ type_register_static(&akitapda_type);
+ type_register_static(&spitzpda_type);
+ type_register_static(&borzoipda_type);
+ type_register_static(&terrierpda_type);
+
type_register_static(&corgi_ssp_info);
type_register_static(&spitz_lcdtg_info);
type_register_static(&spitz_keyboard_info);
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index 3d6486f..3b653c5 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -1394,14 +1394,6 @@ static const TypeInfo lm3s6965evb_type = {
.class_init = lm3s6965evb_class_init,
};
-static void stellaris_machine_init(void)
-{
- type_register_static(&lm3s811evb_type);
- type_register_static(&lm3s6965evb_type);
-}
-
-machine_init(stellaris_machine_init)
-
static void stellaris_i2c_class_init(ObjectClass *klass, void *data)
{
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);
@@ -1446,6 +1438,9 @@ static const TypeInfo stellaris_adc_info = {
static void stellaris_register_types(void)
{
+ type_register_static(&lm3s811evb_type);
+ type_register_static(&lm3s6965evb_type);
+
type_register_static(&stellaris_i2c_info);
type_register_static(&stellaris_gptm_info);
type_register_static(&stellaris_adc_info);
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 912c290..8f48a3c 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -421,14 +421,6 @@ static const TypeInfo versatileab_type = {
.class_init = versatileab_class_init,
};
-static void versatile_machine_init(void)
-{
- type_register_static(&versatilepb_type);
- type_register_static(&versatileab_type);
-}
-
-machine_init(versatile_machine_init)
-
static void vpb_sic_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -447,6 +439,9 @@ static const TypeInfo vpb_sic_info = {
static void versatilepb_register_types(void)
{
+ type_register_static(&versatilepb_type);
+ type_register_static(&versatileab_type);
+
type_register_static(&vpb_sic_info);
}
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 058abbd..e888d46 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -802,4 +802,4 @@ static void vexpress_machine_init(void)
type_register_static(&vexpress_a15_info);
}
-machine_init(vexpress_machine_init);
+type_init(vexpress_machine_init)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 6bf0d6d..e7cb46a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1095,4 +1095,4 @@ static void machvirt_machine_init(void)
type_register_static(&machvirt_info);
}
-machine_init(machvirt_machine_init);
+type_init(machvirt_machine_init);
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index 8e17a82..7093f3e 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -328,4 +328,4 @@ static void lm32_machine_init(void)
type_register_static(&lm32_uclinux_type);
}
-machine_init(lm32_machine_init)
+type_init(lm32_machine_init)
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 1ab885b..8d7e8ba 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -385,4 +385,4 @@ static void mips_jazz_machine_init(void)
type_register_static(&mips_pica61_type);
}
-machine_init(mips_jazz_machine_init)
+type_init(mips_jazz_machine_init)
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index ec87587..7366b16 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -693,4 +693,4 @@ static void ppc405_machine_init(void)
type_register_static(&taihu_type);
}
-machine_init(ppc405_machine_init)
+type_init(ppc405_machine_init)
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 9f1917f..8fea7b7 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -1570,14 +1570,6 @@ static const TypeInfo sbook_type = {
static void sun4m_register_types(void)
{
- type_register_static(&idreg_info);
- type_register_static(&afx_info);
- type_register_static(&prom_info);
- type_register_static(&ram_info);
-}
-
-static void sun4m_machine_init(void)
-{
type_register_static(&ss5_type);
type_register_static(&ss10_type);
type_register_static(&ss600mp_type);
@@ -1587,7 +1579,11 @@ static void sun4m_machine_init(void)
type_register_static(&ss4_type);
type_register_static(&scls_type);
type_register_static(&sbook_type);
+
+ type_register_static(&idreg_info);
+ type_register_static(&afx_info);
+ type_register_static(&prom_info);
+ type_register_static(&ram_info);
}
type_init(sun4m_register_types)
-machine_init(sun4m_machine_init)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index a6b5957..46c8714 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -1016,17 +1016,13 @@ static const TypeInfo niagara_type = {
static void sun4u_register_types(void)
{
- type_register_static(&ebus_info);
- type_register_static(&prom_info);
- type_register_static(&ram_info);
-}
-
-static void sun4u_machine_init(void)
-{
type_register_static(&sun4u_type);
type_register_static(&sun4v_type);
type_register_static(&niagara_type);
+
+ type_register_static(&ebus_info);
+ type_register_static(&prom_info);
+ type_register_static(&ram_info);
}
type_init(sun4u_register_types)
-machine_init(sun4u_machine_init)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 7aca1cf..3cd76aa 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -496,4 +496,4 @@ static void xtensa_lx_machines_init(void)
type_register_static(&xtensa_kc705_type);
}
-machine_init(xtensa_lx_machines_init)
+type_init(xtensa_lx_machines_init)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3e9a92c..f5f4a17 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -147,6 +147,6 @@ struct MachineState {
{ \
type_register_static(&machine_initfn##_typeinfo); \
} \
- machine_init(machine_initfn##_register_types)
+ type_init(machine_initfn##_register_types)
#endif
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 3e002c9..b828bb9 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -717,7 +717,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
{ \
type_register(&pc_machine_type_##suffix); \
} \
- machine_init(pc_machine_init_##suffix)
+ type_init(pc_machine_init_##suffix)
#define SET_MACHINE_COMPAT(m, COMPAT) do { \
static GlobalProperty props[] = { \
--
2.1.4
next prev parent reply other threads:[~2015-09-19 15:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-19 15:36 [Qemu-devel] [PATCH 0/6] machine: Deprecate machine_init() Andreas Färber
2015-09-19 15:36 ` Andreas Färber [this message]
2015-09-19 15:36 ` [Qemu-devel] [PATCH 2/6] hw/s390x/css: Use type_init() instead of machine_init() Andreas Färber
2015-09-21 8:04 ` Christian Borntraeger
2015-09-19 15:36 ` [Qemu-devel] [PATCH 3/6] Introduce config_init() for QemuOpts Andreas Färber
2015-09-19 15:36 ` [Qemu-devel] [PATCH 4/6] Drop machine_init() and MODULE_INIT_MACHINE Andreas Färber
2015-09-19 15:36 ` [Qemu-devel] [PATCH 5/6] exynos4: Further QOM'ify machines Andreas Färber
2015-09-19 15:36 ` [Qemu-devel] [PATCH 6/6] pc: Use type_register_static() for machine types Andreas Färber
2015-09-21 15:53 ` [Qemu-devel] [PATCH 0/6] machine: Deprecate machine_init() Eduardo Habkost
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=1442677004-4482-2-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=d.solodkiy@samsung.com \
--cc=e.voevodin@samsung.com \
--cc=hpoussin@reactos.org \
--cc=i.mitsyanko@gmail.com \
--cc=jcmvbkbc@gmail.com \
--cc=leon.alrae@imgtec.com \
--cc=m.kozlov@samsung.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=michael@walle.cc \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=robh@kernel.org \
/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).