diff options
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r-- | hw/ppc/spapr.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f7c5df3..d682f01 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2129,7 +2129,7 @@ static void spapr_init_cpus(sPAPRMachineState *spapr) { MachineState *machine = MACHINE(spapr); MachineClass *mc = MACHINE_GET_CLASS(machine); - char *type = spapr_get_cpu_core_type(machine->cpu_model); + const char *type = spapr_get_cpu_core_type(machine->cpu_type); int smt = kvmppc_smt_threads(); const CPUArchIdList *possible_cpus; int boot_cores_nr = smp_cpus / smp_threads; @@ -2184,7 +2184,6 @@ static void spapr_init_cpus(sPAPRMachineState *spapr) object_property_set_bool(core, true, "realized", &error_fatal); } } - g_free(type); } static void spapr_set_vsmt_mode(sPAPRMachineState *spapr, Error **errp) @@ -2369,12 +2368,6 @@ static void ppc_spapr_init(MachineState *machine) } /* init CPUs */ - if (machine->cpu_model == NULL) { - machine->cpu_model = kvm_enabled() ? "host" : smc->tcg_default_cpu; - } - - cpu_parse_cpu_model(TYPE_POWERPC_CPU, machine->cpu_model); - spapr_set_vsmt_mode(spapr, &error_fatal); spapr_init_cpus(spapr); @@ -3277,7 +3270,7 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, MachineClass *mc = MACHINE_GET_CLASS(hotplug_dev); Error *local_err = NULL; CPUCore *cc = CPU_CORE(dev); - char *base_core_type = spapr_get_cpu_core_type(machine->cpu_model); + const char *base_core_type = spapr_get_cpu_core_type(machine->cpu_type); const char *type = object_get_typename(OBJECT(dev)); CPUArchId *core_slot; int index; @@ -3323,7 +3316,6 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, numa_cpu_pre_plug(core_slot, dev, &local_err); out: - g_free(base_core_type); error_propagate(errp, local_err); } @@ -3622,7 +3614,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) hc->unplug_request = spapr_machine_device_unplug_request; smc->dr_lmb_enabled = true; - smc->tcg_default_cpu = "power8_v2.0"; + mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0"); mc->has_hotpluggable_cpus = true; smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED; fwc->get_dev_path = spapr_get_fw_dev_path; @@ -3868,7 +3860,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); spapr_machine_2_8_class_options(mc); - smc->tcg_default_cpu = "power7_v2.3"; + mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); smc->phb_placement = phb_placement_2_7; } |