mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
fdc: Exit if ISA controller does not support DMA
A "powernv" machine type defines an ISA bus but it does not add any DMA controller to it so it is possible to hit assert(fdctrl->dma) by adding "-machine powernv -device isa-fdc". This replaces assert() with an error message. Signed-off-by: Alexey Kardashevskiy <[email protected]> [thuth: Slightly adjusted error message and updated scripts/device-crash-test] Signed-off-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
This commit is contained in:
1 parent
089eac81e1
commit
b3da551389
1 file changed
+4
-1
+4
-1
@@ -2695,7 +2695,10 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)
|
||||
fdctrl->dma_chann = isa->dma;
|
||||
if (fdctrl->dma_chann != -1) {
|
||||
fdctrl->dma = isa_get_dma(isa_bus_from_device(isadev), isa->dma);
|
||||
assert(fdctrl->dma);
|
||||
if (!fdctrl->dma) {
|
||||
error_setg(errp, "ISA controller does not support DMA");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
qdev_set_legacy_instance_id(dev, isa->iobase, 2);
|
||||
|
||||
Reference in new issue
Block a user