hw/ppc/spapr: Look up CPU alias names instead of hard-coding the aliases
commit4babfaf05d020eab7d6469d12ce77cc142d22276
authorThomas Huth <thuth@redhat.com>
Tue, 9 Aug 2016 16:59:59 +0000 (9 18:59 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 10 Aug 2016 03:12:20 +0000 (10 13:12 +1000)
treeb54b03c6021b294a1ab863969546cdffe23f872b
parentcaf6316de90301e07444de95bd540c93ce9d333a
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>
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c