All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qemu] fdc: Exit if ISA controller does not support DMA
@ 2017-10-26  6:46 Alexey Kardashevskiy
  2017-11-07  0:58 ` John Snow
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Kardashevskiy @ 2017-10-26  6:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy

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 <aik@ozlabs.ru>
---

Is it a must for ISA to have DMA controllers?


---
 hw/block/fdc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 67f78ac702..ed8b367572 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2700,7 +2700,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, exiting");
+            return;
+        }
     }
 
     qdev_set_legacy_instance_id(dev, isa->iobase, 2);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-15 21:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  6:46 [Qemu-devel] [PATCH qemu] fdc: Exit if ISA controller does not support DMA Alexey Kardashevskiy
2017-11-07  0:58 ` John Snow
2017-11-22  2:48   ` Alexey Kardashevskiy
2017-12-08 21:29     ` John Snow
2017-12-13  6:19       ` Hervé Poussineau
2018-03-05 10:29         ` Philippe Mathieu-Daudé
2018-03-05 19:03           ` Philippe Mathieu-Daudé
2018-03-05 10:15       ` Thomas Huth
2018-03-15 21:08         ` John Snow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.