From: Laszlo Ersek <ler...@redhat.com>

Even if board code decides not to request the creation of the FDC (keyed
off board-level factors, to be determined later), we should create the FDC
nevertheless if the user passes '-drive if=floppy' on the command line.

Otherwise '-drive if=floppy' would break without explicit '-device
isa-fdc' on such boards.

Cc: Markus Armbruster <arm...@redhat.com>
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: John Snow <js...@redhat.com>
Cc: "Gabriel L. Somlo" <gso...@gmail.com>
Cc: "Michael S. Tsirkin" <m...@redhat.com>
Cc: Kevin Wolf <kw...@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
Reviewed-by: Michael S. Tsirkin <m...@redhat.com>
Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
Reviewed-by: Markus Armbruster <arm...@redhat.com>
---
 hw/i386/pc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b2fc501..1eb1db0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1490,6 +1490,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
 
     for(i = 0; i < MAX_FD; i++) {
         fd[i] = drive_get(IF_FLOPPY, 0, i);
+        create_fdctrl |= !!fd[i];
     }
     *floppy = create_fdctrl ? fdctrl_init_isa(isa_bus, fd) : NULL;
 }
-- 
MST


Reply via email to