This adds a little more boilerplate code, but makes all *machine_options() and *class_init() functions follow exactly the same nesting pattern, making it much easier to eliminate *machine_options() later.
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/i386/pc_piix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 05d1241..1c5f4b5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -462,6 +462,12 @@ static TypeInfo pc_i440fx_machine_v2_0_type_info = { .class_init = pc_i440fx_machine_v2_0_class_init, }; +static void pc_i440fx_1_7_machine_options(MachineClass *mc) +{ + pc_i440fx_2_1_machine_options(mc); + mc->default_machine_opts = NULL; +} + static void pc_i440fx_machine_v1_7_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -469,6 +475,7 @@ static void pc_i440fx_machine_v1_7_class_init(ObjectClass *oc, void *data) PC_COMPAT_1_7, { /* end of list */ } }; + pc_i440fx_1_7_machine_options(mc); mc->init = pc_init_pci_1_7; mc->name = "pc-i440fx-1.7"; machine_class_add_compat_props(mc, compat_props); @@ -487,6 +494,7 @@ static void pc_i440fx_machine_v1_6_class_init(ObjectClass *oc, void *data) PC_COMPAT_1_6, { /* end of list */ } }; + pc_i440fx_1_7_machine_options(mc); mc->init = pc_init_pci_1_6; mc->name = "pc-i440fx-1.6"; machine_class_add_compat_props(mc, compat_props); @@ -505,6 +513,7 @@ static void pc_i440fx_machine_v1_5_class_init(ObjectClass *oc, void *data) PC_COMPAT_1_5, { /* end of list */ } }; + pc_i440fx_1_7_machine_options(mc); mc->init = pc_init_pci_1_5; mc->name = "pc-i440fx-1.5"; machine_class_add_compat_props(mc, compat_props); @@ -518,6 +527,7 @@ static TypeInfo pc_i440fx_machine_v1_5_type_info = { static void pc_i440fx_1_4_machine_options(MachineClass *mc) { + pc_i440fx_1_7_machine_options(mc); mc->hot_add_cpu = NULL; } -- 1.9.0