summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Hrdina <phrdina@redhat.com>2012-06-13 15:43:11 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-06-29 23:14:15 -0300
commitbd11ac4feb54d32653e5d4eb7994bed18be0609c (patch)
tree3712801b873440bd78a87c39a89594ea0b4a9bb9
parentkvm: i8254: Fix conversion of in-kernel to userspace state (diff)
downloadqemu-kvm-bd11ac4feb54d32653e5d4eb7994bed18be0609c.tar.gz
qemu-kvm-bd11ac4feb54d32653e5d4eb7994bed18be0609c.tar.bz2
qemu-kvm-bd11ac4feb54d32653e5d4eb7994bed18be0609c.zip
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 <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--hw/fdc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/fdc.c b/hw/fdc.c
index 30d34e3f1..be3520112 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;
}