aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-08-09 18:59:59 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-08-10 13:12:20 +1000
commit4babfaf05d020eab7d6469d12ce77cc142d22276 (patch)
treeb54b03c6021b294a1ab863969546cdffe23f872b /hw/ppc/spapr.c
parentcaf6316de90301e07444de95bd540c93ce9d333a (diff)
downloadqemu-4babfaf05d020eab7d6469d12ce77cc142d22276.zip
qemu-4babfaf05d020eab7d6469d12ce77cc142d22276.tar.gz
qemu-4babfaf05d020eab7d6469d12ce77cc142d22276.tar.bz2
hw/ppc/spapr: Look up CPU alias names instead of hard-coding the aliases
Hard-coding the CPU alias names in the spapr_cores[] array has two big disadvantages: 1) We register a real type with the CPU alias name in spapr_cpu_core_register_types() - this prevents us from registering a CPU family name in kvm_ppc_register_host_cpu_type() with the same name (as we do it for the non-hotpluggable CPU types). 2) It's quite cumbersome to maintain the aliases here in sync with the ppc_cpu_aliases list from target-ppc/cpu-models.c. So let's simply add proper alias lookup to the spapr cpu core code, too (by checking whether the given model can be used directly, and if not by trying to look up the given model as an alias name instead). Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 399dcc0..0787c66 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1815,7 +1815,7 @@ static void ppc_spapr_init(MachineState *machine)
if (mc->query_hotpluggable_cpus) {
char *type = spapr_get_cpu_core_type(machine->cpu_model);
- if (!object_class_by_name(type)) {
+ if (type == NULL) {
error_report("Unable to find sPAPR CPU Core definition");
exit(1);
}