From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiEJT-000811-TN for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiEJS-0008C6-31 for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:55 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:50139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiEJR-0007rl-Po for qemu-devel@nongnu.org; Fri, 22 Jun 2012 20:34:53 -0400 Received: by mail-pz0-f45.google.com with SMTP id n2so3053134dad.4 for ; Fri, 22 Jun 2012 17:34:52 -0700 (PDT) Sender: fluxion From: Michael Roth Date: Fri, 22 Jun 2012 19:33:29 -0500 Message-Id: <1340411610-22596-26-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1340411610-22596-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1340411610-22596-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH stable-1.1 25/26] fdc: fix implied seek while there is no media in drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com From: Pavel Hrdina 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 --- hw/fdc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 30d34e3..be35201 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; } -- 1.7.4.1