From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeP8X-0002au-RF for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeP8Q-0006Gj-I0 for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:19:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeP8Q-0006GB-A3 for qemu-devel@nongnu.org; Tue, 12 Jun 2012 07:19:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5CBJedX000754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Jun 2012 07:19:41 -0400 From: Pavel Hrdina Date: Tue, 12 Jun 2012 13:19:34 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH v3 1/4] fdc: fix implied seek while there is no medina in drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: 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 --- hw/fdc.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 30d34e3..096aefc 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -159,6 +159,9 @@ 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.7.6