qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 6/7] Use DEFINE_MACHINE to register all machi


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v3 6/7] Use DEFINE_MACHINE to register all machines
Date: Sat, 19 Sep 2015 10:28:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Am 19.09.2015 um 10:27 schrieb Andreas Färber:
> 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 <address@hidden>
>>> Cc: Peter Maydell <address@hidden>
>>> Cc: Li Guang <address@hidden>
>>> Cc: Antony Pavlov <address@hidden>
>>> Cc: Evgeny Voevodin <address@hidden>
>>> Cc: Maksim Kozlov <address@hidden>
>>> Cc: Igor Mitsyanko <address@hidden>
>>> Cc: Dmitry Solodkiy <address@hidden>
>>> Cc: Rob Herring <address@hidden>
>>> Cc: Peter Chubb <address@hidden>
>>> Cc: Jan Kiszka <address@hidden>
>>> Cc: Andrzej Zaborowski <address@hidden>
>>> Cc: Peter Crosthwaite <address@hidden>
>>> Cc: "Edgar E. Iglesias" <address@hidden>
>>> Cc: Michael Walle <address@hidden>
>>> Cc: Aurelien Jarno <address@hidden>
>>> Cc: Leon Alrae <address@hidden>
>>> Cc: "Hervé Poussineau" <address@hidden>
>>> Cc: Jia Liu <address@hidden>
>>> Cc: Alexander Graf <address@hidden>
>>> Cc: Scott Wood <address@hidden>
>>> Cc: "Andreas Färber" <address@hidden>
>>> Cc: Magnus Damm <address@hidden>
>>> Cc: Fabien Chouteau <address@hidden>
>>> Cc: Blue Swirl <address@hidden>
>>> Cc: Mark Cave-Ayland <address@hidden>
>>> Cc: Bastian Koppelmann <address@hidden>
>>> Cc: Guan Xuetao <address@hidden>
>>> Cc: Max Filippov <address@hidden>
>>> Cc: address@hidden
>>> Signed-off-by: Eduardo Habkost <address@hidden>
>>> ---
>>> 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 <address@hidden>
>>> * 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)

+DEFINE_MACHINE("imx25_pdk", 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]