From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwUHb-0006GW-Do for qemu-devel@nongnu.org; Mon, 16 Jun 2014 06:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwUHT-0000SO-VB for qemu-devel@nongnu.org; Mon, 16 Jun 2014 06:36:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35513 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwUHT-0000SH-KW for qemu-devel@nongnu.org; Mon, 16 Jun 2014 06:36:51 -0400 Message-ID: <539EC8C1.80006@suse.de> Date: Mon, 16 Jun 2014 12:36:49 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1402688658-22333-1-git-send-email-ehabkost@redhat.com> <1402688658-22333-9-git-send-email-ehabkost@redhat.com> In-Reply-To: <1402688658-22333-9-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC v2 08/39] pc: Register machine classes directly instead of using QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , "Michael S. Tsirkin" , Alexander Graf , Don Slutz , Anthony Liguori , Igor Mammedov Am 13.06.2014 21:43, schrieb Eduardo Habkost: > This is a (mostly) blind and mechanical conversion of the PC QEMUMachin= e > definitions to corresponding class registration code. >=20 > Having the PC code converted to pure QOM registration code will help us > move PC-specific machine state that is currently held in static > variables inside PC machine objects, and reduce duplication between > pc_piix.c and pc_q35.c. >=20 > Signed-off-by: Eduardo Habkost > Cc: Igor Mammedov > --- > Changes v1 -> v2: > * Remove unused PC_DEFAULT_MACHINE_OPTIONS macro leftover > * Use machine_class_register_global_props_array() > * Rebase on top of Michael's pci tree > * Eliminate qemu_register_pc_machine(), as it is not needed anymore > --- > hw/i386/pc.c | 44 ----- > hw/i386/pc_piix.c | 473 +++++++++++++++++++++++++++++++++++--------= -------- > hw/i386/pc_q35.c | 171 +++++++++++++------ > include/hw/i386/pc.h | 17 +- > 4 files changed, 448 insertions(+), 257 deletions(-) [...] > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index dd52183..bb7a788 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -405,81 +405,140 @@ static void pc_xen_hvm_init(MachineState *machin= e) > } > #endif > =20 > -#define PC_I440FX_MACHINE_OPTIONS \ > - PC_DEFAULT_MACHINE_OPTIONS, \ > - .desc =3D "Standard PC (i440FX + PIIX, 1996)", \ > - .hot_add_cpu =3D pc_hot_add_cpu > - > -#define PC_I440FX_2_1_MACHINE_OPTIONS \ > - PC_I440FX_MACHINE_OPTIONS, \ > - .default_machine_opts =3D "firmware=3Dbios-256k.bin" > - > -static QEMUMachine pc_i440fx_machine_v2_1 =3D { > - PC_I440FX_2_1_MACHINE_OPTIONS, > - .name =3D "pc-i440fx-2.1", > - .alias =3D "pc", > - .init =3D pc_init_pci, > - .is_default =3D 1, > +static void pc_i440fx_machine_options(MachineClass *mc) > +{ > + pc_default_machine_options(mc); > + mc->desc =3D "Standard PC (i440FX + PIIX, 1996)"; > + mc->hot_add_cpu =3D pc_hot_add_cpu; > +} > + > +static void pc_i440fx_2_1_machine_options(MachineClass *mc) > +{ > + pc_i440fx_machine_options(mc); > + mc->default_machine_opts =3D "firmware=3Dbios-256k.bin"; > +} > + > +static void pc_i440fx_machine_v2_1_class_init(ObjectClass *oc, void *d= ata) > +{ > + MachineClass *mc =3D MACHINE_CLASS(oc); > + pc_i440fx_2_1_machine_options(mc); > + mc->alias =3D "pc"; > + mc->init =3D pc_init_pci; > + mc->is_default =3D 1; > + mc->name =3D "pc-i440fx-2.1"; > +} > + > +static TypeInfo pc_i440fx_machine_v2_1_type_info =3D { static const TypeInfo please, or explain why not. (recurring issue) Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg