From patchwork Wed Jun 13 13:43:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 164693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AC3E7B6FA9 for ; Wed, 13 Jun 2012 23:43:54 +1000 (EST) Received: from localhost ([::1]:42403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SenrU-00068G-G6 for incoming@patchwork.ozlabs.org; Wed, 13 Jun 2012 09:43:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Senr3-0005YF-L8 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:43:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Senqx-0004MU-AX for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:43:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Senqx-0004M4-2t for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:43:19 -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 q5DDhHBs009585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Jun 2012 09:43:17 -0400 Received: from antique-laptop.brq.redhat.com (dhcp-27-171.brq.redhat.com [10.34.27.171]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5DDhFMJ009415; Wed, 13 Jun 2012 09:43:16 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Wed, 13 Jun 2012 15:43:11 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Pavel Hrdina Subject: [Qemu-devel] [PATCH v5 1/4] fdc: fix implied seek while there is no media in drive X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 | 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; }