diff options
Diffstat (limited to 'hw/ppc')
| -rw-r--r-- | hw/ppc/spapr.c | 102 |
1 files changed, 17 insertions, 85 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7afd1a175b..55be0f56cb 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3939,16 +3939,10 @@ static const TypeInfo spapr_machine_info = { mc->is_default = 1; \ } \ } \ - static void spapr_machine_##suffix##_instance_init(Object *obj) \ - { \ - MachineState *machine = MACHINE(obj); \ - spapr_machine_##suffix##_instance_options(machine); \ - } \ static const TypeInfo spapr_machine_##suffix##_info = { \ .name = MACHINE_TYPE_NAME("pseries-" verstr), \ .parent = TYPE_SPAPR_MACHINE, \ .class_init = spapr_machine_##suffix##_class_init, \ - .instance_init = spapr_machine_##suffix##_instance_init, \ }; \ static void spapr_machine_register_##suffix(void) \ { \ @@ -3956,19 +3950,29 @@ static const TypeInfo spapr_machine_info = { } \ type_init(spapr_machine_register_##suffix) - /* - * pseries-3.1 +/* + * pseries-4.0 */ -static void spapr_machine_3_1_instance_options(MachineState *machine) +static void spapr_machine_4_0_class_options(MachineClass *mc) { + /* Defaults for the latest behaviour inherited from the base class */ } +DEFINE_SPAPR_MACHINE(4_0, "4.0", true); + +/* + * pseries-3.1 + */ +#define SPAPR_COMPAT_3_1 \ + HW_COMPAT_3_1 + static void spapr_machine_3_1_class_options(MachineClass *mc) { - /* Defaults for the latest behaviour inherited from the base class */ + spapr_machine_4_0_class_options(mc); + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_1); } -DEFINE_SPAPR_MACHINE(3_1, "3.1", true); +DEFINE_SPAPR_MACHINE(3_1, "3.1", false); /* * pseries-3.0 @@ -3976,11 +3980,6 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", true); #define SPAPR_COMPAT_3_0 \ HW_COMPAT_3_0 -static void spapr_machine_3_0_instance_options(MachineState *machine) -{ - spapr_machine_3_1_instance_options(machine); -} - static void spapr_machine_3_0_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4010,11 +4009,6 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false); .value = "on", \ }, -static void spapr_machine_2_12_instance_options(MachineState *machine) -{ - spapr_machine_3_0_instance_options(machine); -} - static void spapr_machine_2_12_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4032,11 +4026,6 @@ static void spapr_machine_2_12_class_options(MachineClass *mc) DEFINE_SPAPR_MACHINE(2_12, "2.12", false); -static void spapr_machine_2_12_sxxm_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4055,11 +4044,6 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false); #define SPAPR_COMPAT_2_11 \ HW_COMPAT_2_11 -static void spapr_machine_2_11_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_11_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4077,11 +4061,6 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false); #define SPAPR_COMPAT_2_10 \ HW_COMPAT_2_10 -static void spapr_machine_2_10_instance_options(MachineState *machine) -{ - spapr_machine_2_11_instance_options(machine); -} - static void spapr_machine_2_10_class_options(MachineClass *mc) { spapr_machine_2_11_class_options(mc); @@ -4101,11 +4080,6 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false); .value = "on", \ }, \ -static void spapr_machine_2_9_instance_options(MachineState *machine) -{ - spapr_machine_2_10_instance_options(machine); -} - static void spapr_machine_2_9_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4130,11 +4104,6 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false); .value = "off", \ }, -static void spapr_machine_2_8_instance_options(MachineState *machine) -{ - spapr_machine_2_9_instance_options(machine); -} - static void spapr_machine_2_8_class_options(MachineClass *mc) { spapr_machine_2_9_class_options(mc); @@ -4219,20 +4188,13 @@ 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) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(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; } @@ -4250,11 +4212,6 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false); .value = stringify(off),\ }, -static void spapr_machine_2_6_instance_options(MachineState *machine) -{ - spapr_machine_2_7_instance_options(machine); -} - static void spapr_machine_2_6_class_options(MachineClass *mc) { spapr_machine_2_7_class_options(mc); @@ -4275,11 +4232,6 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false); .value = "off", \ }, -static void spapr_machine_2_5_instance_options(MachineState *machine) -{ - spapr_machine_2_6_instance_options(machine); -} - static void spapr_machine_2_5_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4297,11 +4249,6 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false); #define SPAPR_COMPAT_2_4 \ HW_COMPAT_2_4 -static void spapr_machine_2_4_instance_options(MachineState *machine) -{ - spapr_machine_2_5_instance_options(machine); -} - static void spapr_machine_2_4_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); @@ -4324,11 +4271,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); .value = "off",\ }, -static void spapr_machine_2_3_instance_options(MachineState *machine) -{ - spapr_machine_2_4_instance_options(machine); -} - static void spapr_machine_2_3_class_options(MachineClass *mc) { spapr_machine_2_4_class_options(mc); @@ -4348,16 +4290,11 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false); .value = "0x20000000",\ }, -static void spapr_machine_2_2_instance_options(MachineState *machine) -{ - spapr_machine_2_3_instance_options(machine); - machine->suppress_vmdesc = true; -} - static void spapr_machine_2_2_class_options(MachineClass *mc) { spapr_machine_2_3_class_options(mc); SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2); + mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on"; } DEFINE_SPAPR_MACHINE(2_2, "2.2", false); @@ -4367,11 +4304,6 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false); #define SPAPR_COMPAT_2_1 \ HW_COMPAT_2_1 -static void spapr_machine_2_1_instance_options(MachineState *machine) -{ - spapr_machine_2_2_instance_options(machine); -} - static void spapr_machine_2_1_class_options(MachineClass *mc) { spapr_machine_2_2_class_options(mc); |