From: Pavel Hrdina Date: Wed, 13 Jun 2012 13:43:11 +0000 (+0200) Subject: fdc: fix implied seek while there is no media in drive X-Git-Tag: v1.1.1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70d582074f0b9485ad9800f8e0126ef68608ba85;p=thirdparty%2Fqemu.git fdc: fix implied seek while there is no media in drive 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 Signed-off-by: Kevin Wolf (cherry picked from commit c52acf60b6c12ff5eb58eb6ac568c159ae0c8737) Signed-off-by: Michael Roth --- diff --git a/hw/fdc.c b/hw/fdc.c index 30d34e3f1dd..be352011273 100644 --- 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; }