Am 19.09.2015 um 10:13 schrieb Andreas Färber:
> Am 04.09.2015 um 20:37 schrieb Eduardo Habkost:
>> Convert all machines to use DEFINE_MACHINE instead of QEMUMachine
>> automatically using a script.
>>
>> Cc: Richard Henderson <[email protected]>
>> Cc: Peter Maydell <[email protected]>
>> Cc: Li Guang <[email protected]>
>> Cc: Antony Pavlov <[email protected]>
>> Cc: Evgeny Voevodin <[email protected]>
>> Cc: Maksim Kozlov <[email protected]>
>> Cc: Igor Mitsyanko <[email protected]>
>> Cc: Dmitry Solodkiy <[email protected]>
>> Cc: Rob Herring <[email protected]>
>> Cc: Peter Chubb <[email protected]>
>> Cc: Jan Kiszka <[email protected]>
>> Cc: Andrzej Zaborowski <[email protected]>
>> Cc: Peter Crosthwaite <[email protected]>
>> Cc: "Edgar E. Iglesias" <[email protected]>
>> Cc: Michael Walle <[email protected]>
>> Cc: Aurelien Jarno <[email protected]>
>> Cc: Leon Alrae <[email protected]>
>> Cc: "Hervé Poussineau" <[email protected]>
>> Cc: Jia Liu <[email protected]>
>> Cc: Alexander Graf <[email protected]>
>> Cc: Scott Wood <[email protected]>
>> Cc: "Andreas Färber" <[email protected]>
>> Cc: Magnus Damm <[email protected]>
>> Cc: Fabien Chouteau <[email protected]>
>> Cc: Blue Swirl <[email protected]>
>> Cc: Mark Cave-Ayland <[email protected]>
>> Cc: Bastian Koppelmann <[email protected]>
>> Cc: Guan Xuetao <[email protected]>
>> Cc: Max Filippov <[email protected]>
>> Cc: [email protected]
>> Signed-off-by: Eduardo Habkost <[email protected]>
>> ---
>> Changes v1 -> v2:
>> * Fix trailing spaces and newlines
>> * Don't touch "//" comments on lines that we are not changing
>> * Break long lines manually
>>
>> Changes v2 -> v3:
>> * Replace "machine_machine" with "machine" in new variable and function
>> names.
>> Suggested-by: Michael Walle <[email protected]>
>> * Eliminate empty mips_malta_machine_init() and sun4u_machine_init()
>> functions
>
> In most (but not all) cases the last DEFINE_MACHINE(...) added a white
> line, dropped manually.
>
> Your script also always added a semicolon after DEFINE_MACHINE(), even
> when the original machine_init() did not have it. Cleaned up manually.
>
> This scripted approach also regresses files with multiple machines to
> now have one module init function per machine rather than one per file.
>
> I'm also not clear on why you chose to diverge from devices in having a
> machine-specific init function with MachineClass *mc arg rather than
> having ObjectClass *oc, void *data and having a local mc variable.
>
> But getting this conversion done to drop the old infrastructure seems
> more important, and this can be revisited afterwards.
The following conversion has become necessary on top (squashing):
diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index c34667f..4250114 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -145,15 +145,10 @@ static void imx25_pdk_init(MachineState *machine)
}
}
-static QEMUMachine imx25_pdk_machine = {
- .name = "imx25_pdk",
- .desc = "ARM i.MX25 PDK board (ARM926)",
- .init = imx25_pdk_init,
-};
-
-static void imx25_pdk_machine_init(void)
+static void imx25_pdk_machine_init(MachineClass *mc)
{
- qemu_register_machine(&imx25_pdk_machine);
+ mc->desc = "ARM i.MX25 PDK board (ARM926)";
+ mc->init = imx25_pdk_init;
}
-machine_init(imx25_pdk_machine_init)
Regards,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)