Received: from eggs.gnu.org ([2001:4830:134:3::10]:58094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze2kB-0002o1-P8 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 11:11:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze2kA-00037q-Cw for qemu-devel@nongnu.org; Mon, 21 Sep 2015 11:11:03 -0400 Date: Mon, 21 Sep 2015 12:10:54 -0300 From: Eduardo Habkost Message-ID: <20150921151054.GC4004@thinpad.lan.raisama.net> References: <1441391829-28017-1-git-send-email-ehabkost@redhat.com> <1441391829-28017-7-git-send-email-ehabkost@redhat.com> <55FD1921.5050903@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <55FD1921.5050903@suse.de> 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: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , Evgeny Voevodin , "Michael S. Tsirkin" , Mark Cave-Ayland , qemu-devel@nongnu.org, Blue Swirl , Max Filippov , "Edgar E. Iglesias" , Guan Xuetao , Rob Herring , Jia Liu , Alexander Graf , =?iso-8859-1?Q?Herv=E9?= Poussineau , Antony Pavlov , Maksim Kozlov , Leon Alrae , Marcel Apfelbaum , Fabien Chouteau , Aurelien Jarno , Peter Chubb , Scott Wood , Richard Henderson , Peter Crosthwaite , Igor Mitsyanko , Bastian Koppelmann , Michael Walle , qemu-ppc@nongnu.org, Dmitry Solodkiy , Jan Kiszka , Li Guang On Sat, Sep 19, 2015 at 10:13:21AM +0200, Andreas F=E4rber wrote: > Am 04.09.2015 um 20:37 schrieb Eduardo Habkost: > > Convert all machines to use DEFINE_MACHINE instead of QEMUMachine > > automatically using a script. [...] > > Changes v1 -> v2: > > * Fix trailing spaces and newlines > > * Don't touch "//" comments on lines that we are not changing > > * Break long lines manually > >=20 > > 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 >=20 > In most (but not all) cases the last DEFINE_MACHINE(...) added a white > line, dropped manually. >=20 > Your script also always added a semicolon after DEFINE_MACHINE(), even > when the original machine_init() did not have it. Cleaned up manually. We could use the conversion as an opportunity to make the code more consistent: to either remove the semicolon from all files, or using a semicolon on all of them. (I don't know which way is better.) >=20 > This scripted approach also regresses files with multiple machines to > now have one module init function per machine rather than one per file. Is that a problem? >=20 > 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. I wasn't 100% sure what was the best option, but I decided that I liked to get more type safety and shorter class init functions for free when using the macro. >=20 > But getting this conversion done to drop the old infrastructure seems > more important, and this can be revisited afterwards. >=20 Thanks! --=20 Eduardo