]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
fdc: fix implied seek while there is no media in drive
authorPavel Hrdina <phrdina@redhat.com>
Wed, 13 Jun 2012 13:43:11 +0000 (15:43 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Jun 2012 12:03:43 +0000 (14:03 +0200)
The Windows uses 'READ' command at the start of an instalation
without checking the 'dir' register. We have to abort the transfer
with an abnormal termination if there is no media in the drive.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/fdc.c

index bfa4e686fa3c8246b4de0f7f5c679ff9fe7d370f..78b4e3309c3e2ce21508986a51934534ce1883da 100644 (file)
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -159,6 +159,10 @@ static int fd_seek(FDrive *drv, uint8_t head, uint8_t track, uint8_t sect,
         drv->sect = sect;
     }
 
+    if (drv->bs == NULL || !bdrv_is_inserted(drv->bs)) {
+        ret = 2;
+    }
+
     return ret;
 }