diff options
-rw-r--r-- | hw/ppc/spapr_cpu_core.c | 5 | ||||
-rwxr-xr-x | scripts/device-crash-test | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index ea278ce2a7..dd9232620d 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -220,6 +220,11 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp) void *obj; int i, j; + if (!object_dynamic_cast(qdev_get_machine(), TYPE_SPAPR_MACHINE)) { + error_setg(errp, "spapr-cpu-core needs a pseries machine"); + return; + } + sc->threads = g_malloc0(size * cc->nr_threads); for (i = 0; i < cc->nr_threads; i++) { char id[32]; diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 81d65b9617..043b24a4aa 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -160,6 +160,9 @@ ERROR_WHITELIST = [ {'machine':'q35|pc.*', 'device':'kvm-ioapic', 'expected':True}, # Only 1 ioapics allowed {'machine':'q35|pc.*', 'device':'ioapic', 'expected':True}, # Only 1 ioapics allowed + # "spapr-cpu-core needs a pseries machine" + {'machine':'(?!pseries).*', 'device':'.*-spapr-cpu-core', 'expected':True}, + # KVM-specific devices shouldn't be tried without accel=kvm: {'accel':'(?!kvm).*', 'device':'kvmclock', 'expected':True}, {'accel':'(?!kvm).*', 'device':'kvm-pci-assign', 'expected':True}, |