diff mbox series

[for-4.1,3/4] hw/isa/superio: Support chipsets with no Floppy Disk controller

Message ID 20190404221238.12468-4-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw/mips/r4k: Refactor the Super I/O chipset | expand

Commit Message

Philippe Mathieu-Daudé April 4, 2019, 10:12 p.m. UTC
Not all Super I/O chipsets provide a Floppy Disk Controller.

Without this change, using a Super I/O with no FDC would abort QEMU with:

  Initialization of device isa-fdc failed: ISA controller does not support DMA

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/isa/isa-superio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Huth April 5, 2019, 4:24 a.m. UTC | #1
On 05/04/2019 00.12, Philippe Mathieu-Daudé wrote:
> Not all Super I/O chipsets provide a Floppy Disk Controller.
> 
> Without this change, using a Super I/O with no FDC would abort QEMU with:
> 
>   Initialization of device isa-fdc failed: ISA controller does not support DMA
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/isa/isa-superio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
> index b0761ea1f96..6956f06d529 100644
> --- a/hw/isa/isa-superio.c
> +++ b/hw/isa/isa-superio.c
> @@ -113,7 +113,8 @@ static void isa_superio_realize(DeviceState *dev, Error **errp)
>      }
>  
>      /* Floppy disc */
> -    if (!k->floppy.is_enabled || k->floppy.is_enabled(s, 0)) {
> +    if (k->floppy.count
> +            && (!k->floppy.is_enabled || k->floppy.is_enabled(s, 0))) {
>          isa = isa_create(bus, "isa-fdc");
>          d = DEVICE(isa);
>          if (k->floppy.get_iobase) {

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index b0761ea1f96..6956f06d529 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -113,7 +113,8 @@  static void isa_superio_realize(DeviceState *dev, Error **errp)
     }
 
     /* Floppy disc */
-    if (!k->floppy.is_enabled || k->floppy.is_enabled(s, 0)) {
+    if (k->floppy.count
+            && (!k->floppy.is_enabled || k->floppy.is_enabled(s, 0))) {
         isa = isa_create(bus, "isa-fdc");
         d = DEVICE(isa);
         if (k->floppy.get_iobase) {