diff options
author | Greg Kurz | 2017-10-12 18:30:14 +0200 |
---|---|---|
committer | David Gibson | 2017-10-17 01:34:01 +0200 |
commit | f7d6bfcdc0fe49040aac3ac131a319cb5427957e (patch) | |
tree | 158661a268c3fa4d42bf2d2f8f01f962d1d2cffa /linux-user/elfload.c | |
parent | spapr: Correct RAM size calculation for HPT resizing (diff) | |
download | qemu-f7d6bfcdc0fe49040aac3ac131a319cb5427957e.tar.gz qemu-f7d6bfcdc0fe49040aac3ac131a319cb5427957e.tar.xz qemu-f7d6bfcdc0fe49040aac3ac131a319cb5427957e.zip |
spapr_pci: fail gracefully with non-pseries machine types
QEMU currently crashes when the user tries to add an spapr-pci-host-bridge
on a non-pseries machine:
$ qemu-system-ppc64 -M ppce500 -device spapr-pci-host-bridge,index=1
hw/ppc/spapr_pci.c:1535:spapr_phb_realize:
Object 0x1003dacae60 is not an instance of type spapr-machine
Aborted (core dumped)
The same thing happens with the deprecated but still available child type
spapr-pci-vfio-host-bridge.
Fix both by checking the machine type with object_dynamic_cast().
Reviewed-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'linux-user/elfload.c')
0 files changed, 0 insertions, 0 deletions