[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/16] fdc: Exit if ISA controller does not support D
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 06/16] fdc: Exit if ISA controller does not support DMA |
Date: |
Mon, 26 Mar 2018 15:36:33 +0200 |
From: Alexey Kardashevskiy <address@hidden>
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 <address@hidden>
[thuth: Slightly adjusted error message and updated scripts/device-crash-test]
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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 7b7dd41..cd29e27 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -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);
--
1.8.3.1
- [Qemu-devel] [PULL 00/16] Misc fixes for QEMU 2.12.0-rc1, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 02/16] WHPX fix WHvGetCapability out WrittenSizeInBytes, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 03/16] WHPX fix WHvSetPartitionProperty in PropertyCode, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 04/16] WHPX improve vcpu_post_run perf, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 05/16] hw/net/can: Fix segfaults when using the devices without bus, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 01/16] scripts/get_maintainer.pl: Print proper error message for missing $file, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 07/16] hw/audio: Fix crashes when devices are used on ISA bus without DMA, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 06/16] fdc: Exit if ISA controller does not support DMA,
Paolo Bonzini <=
- [Qemu-devel] [PULL 08/16] scripts/device-crash-test: Remove fixed isapc-with-iommu entry, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 09/16] vhost-user-test: do not hang if chardev creation failed, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 11/16] tcg: Really fix cpu_io_recompile, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 12/16] chardev-socket: remove useless if, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 13/16] scsi: turn "is this a SCSI device?" into a conditional hint, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 14/16] iothread: fix breakage on windows, Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 15/16] chardev/char-fe: Allow NULL chardev in qemu_chr_fe_init(), Paolo Bonzini, 2018/03/26
- [Qemu-devel] [PULL 10/16] vhost-user-test: add back memfd check, Paolo Bonzini, 2018/03/26