From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdDVl-0001A0-0f for qemu-devel@nongnu.org; Sat, 19 Sep 2015 04:28:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdDVh-000780-A9 for qemu-devel@nongnu.org; Sat, 19 Sep 2015 04:28:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:51476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdDVh-00077O-0W for qemu-devel@nongnu.org; Sat, 19 Sep 2015 04:28:41 -0400 References: <1441391829-28017-1-git-send-email-ehabkost@redhat.com> <1441391829-28017-7-git-send-email-ehabkost@redhat.com> <55FD1921.5050903@suse.de> <55FD1C62.7060402@suse.de> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Message-ID: <55FD1CB6.5000704@suse.de> Date: Sat, 19 Sep 2015 10:28:38 +0200 MIME-Version: 1.0 In-Reply-To: <55FD1C62.7060402@suse.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 6/7] Use DEFINE_MACHINE to register all machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Peter Maydell , Marcel Apfelbaum , Jean-Christophe Dubois Am 19.09.2015 um 10:27 schrieb Andreas F=C3=A4rber: > Am 19.09.2015 um 10:13 schrieb Andreas F=C3=A4rber: >> 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 >>> Cc: Peter Maydell >>> Cc: Li Guang >>> Cc: Antony Pavlov >>> Cc: Evgeny Voevodin >>> Cc: Maksim Kozlov >>> Cc: Igor Mitsyanko >>> Cc: Dmitry Solodkiy >>> Cc: Rob Herring >>> Cc: Peter Chubb >>> Cc: Jan Kiszka >>> Cc: Andrzej Zaborowski >>> Cc: Peter Crosthwaite >>> Cc: "Edgar E. Iglesias" >>> Cc: Michael Walle >>> Cc: Aurelien Jarno >>> Cc: Leon Alrae >>> Cc: "Herv=C3=A9 Poussineau" >>> Cc: Jia Liu >>> Cc: Alexander Graf >>> Cc: Scott Wood >>> Cc: "Andreas F=C3=A4rber" >>> Cc: Magnus Damm >>> Cc: Fabien Chouteau >>> Cc: Blue Swirl >>> Cc: Mark Cave-Ayland >>> Cc: Bastian Koppelmann >>> Cc: Guan Xuetao >>> Cc: Max Filippov >>> Cc: qemu-ppc@nongnu.org >>> Signed-off-by: Eduardo Habkost >>> --- >>> 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 functi= on >>> names. >>> Suggested-by: Michael Walle >>> * 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. >=20 > The following conversion has become necessary on top (squashing): >=20 > 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) > } > } >=20 > -static QEMUMachine imx25_pdk_machine =3D { > - .name =3D "imx25_pdk", > - .desc =3D "ARM i.MX25 PDK board (ARM926)", > - .init =3D 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 =3D "ARM i.MX25 PDK board (ARM926)"; > + mc->init =3D imx25_pdk_init; > } >=20 > -machine_init(imx25_pdk_machine_init) +DEFINE_MACHINE("imx25_pdk", imx25_pdk_machine_init) >=20 > Regards, > Andreas >=20 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton; HRB 21284 (AG N= =C3=BCrnberg)