Am 13.06.2014 21:43, schrieb Eduardo Habkost: > This is a (mostly) blind and mechanical conversion of the PC QEMUMachine > definitions to corresponding class registration code. > > 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. > > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> > Cc: Igor Mammedov <imamm...@redhat.com> > --- > 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 *machine) > } > #endif > > -#define PC_I440FX_MACHINE_OPTIONS \ > - PC_DEFAULT_MACHINE_OPTIONS, \ > - .desc = "Standard PC (i440FX + PIIX, 1996)", \ > - .hot_add_cpu = pc_hot_add_cpu > - > -#define PC_I440FX_2_1_MACHINE_OPTIONS \ > - PC_I440FX_MACHINE_OPTIONS, \ > - .default_machine_opts = "firmware=bios-256k.bin" > - > -static QEMUMachine pc_i440fx_machine_v2_1 = { > - PC_I440FX_2_1_MACHINE_OPTIONS, > - .name = "pc-i440fx-2.1", > - .alias = "pc", > - .init = pc_init_pci, > - .is_default = 1, > +static void pc_i440fx_machine_options(MachineClass *mc) > +{ > + pc_default_machine_options(mc); > + mc->desc = "Standard PC (i440FX + PIIX, 1996)"; > + mc->hot_add_cpu = pc_hot_add_cpu; > +} > + > +static void pc_i440fx_2_1_machine_options(MachineClass *mc) > +{ > + pc_i440fx_machine_options(mc); > + mc->default_machine_opts = "firmware=bios-256k.bin"; > +} > + > +static void pc_i440fx_machine_v2_1_class_init(ObjectClass *oc, void *data) > +{ > + MachineClass *mc = MACHINE_CLASS(oc); > + pc_i440fx_2_1_machine_options(mc); > + mc->alias = "pc"; > + mc->init = pc_init_pci; > + mc->is_default = 1; > + mc->name = "pc-i440fx-2.1"; > +} > + > +static TypeInfo pc_i440fx_machine_v2_1_type_info = {
static const TypeInfo please, or explain why not. (recurring issue) Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg