spapr_cpu_core: fail gracefully with non-pseries machine types
commit1bbadc759e23ef8629ef955a4b78f06da2e5a381
authorGreg Kurz <groug@kaod.org>
Mon, 11 Sep 2017 20:52:06 +0000 (11 22:52 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 15 Sep 2017 00:29:48 +0000 (15 10:29 +1000)
tree69f9533de5cb9b12f763ba30295f9c68813be201
parenta1a6bbde4f6a29368f8f605cea2e73630ec1bc7c
spapr_cpu_core: fail gracefully with non-pseries machine types

Since commit 7cca3e466eb0 ("ppc: spapr: Move VCPU ID calculation into
sPAPR"), QEMU aborts when started with a *-spapr-cpu-core device and
a non-pseries machine.

Let's rely on the already existing call to object_dynamic_cast() instead
of using the SPAPR_MACHINE() macro.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_cpu_core.c