Message ID | 20181205205827.19387-3-ehabkost@redhat.com |
---|---|
State | New |
Headers | show |
Series | spapr/virt/pc: Eliminate custom instance_init functions | expand |
On Wed, Dec 05, 2018 at 06:58:24PM -0200, Eduardo Habkost wrote: > Instead of setting use_hotplug_event_source at instance_init > time, set default_machine_opts on spapr_machine_2_7_class_options() > to implement equivalent behavior. > > This will let us eliminate the need for separate instance_init > functions for each spapr machine-type. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> > --- > hw/ppc/spapr.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 80d8498867..f6b60e6fbd 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -4240,10 +4240,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, > > static void spapr_machine_2_7_instance_options(MachineState *machine) > { > - sPAPRMachineState *spapr = SPAPR_MACHINE(machine); > - > spapr_machine_2_8_instance_options(machine); > - spapr->use_hotplug_event_source = false; > } > > static void spapr_machine_2_7_class_options(MachineClass *mc) > @@ -4252,6 +4249,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) > > spapr_machine_2_8_class_options(mc); > mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); > + mc->default_machine_opts = "modern-hotplug-events=off"; > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); > smc->phb_placement = phb_placement_2_7; > }
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 80d8498867..f6b60e6fbd 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4240,10 +4240,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, static void spapr_machine_2_7_instance_options(MachineState *machine) { - sPAPRMachineState *spapr = SPAPR_MACHINE(machine); - spapr_machine_2_8_instance_options(machine); - spapr->use_hotplug_event_source = false; } static void spapr_machine_2_7_class_options(MachineClass *mc) @@ -4252,6 +4249,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) spapr_machine_2_8_class_options(mc); mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); + mc->default_machine_opts = "modern-hotplug-events=off"; SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); smc->phb_placement = phb_placement_2_7; }
Instead of setting use_hotplug_event_source at instance_init time, set default_machine_opts on spapr_machine_2_7_class_options() to implement equivalent behavior. This will let us eliminate the need for separate instance_init functions for each spapr machine-type. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- hw/ppc/spapr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)