]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 25 Jun 2012 13:55:44 +0000 (08:55 -0500)
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>
(cherry picked from commit c52acf60b6c12ff5eb58eb6ac568c159ae0c8737)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/fdc.c

index 30d34e3f1ddd6859ac2b3ce8932b88a80e9df2bf..be3520112733b322067b3647403d12a298af144e 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;
 }