From patchwork Tue Jun 5 13:48:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Hrdina X-Patchwork-Id: 163085 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 880DF1007F9 for ; Tue, 5 Jun 2012 23:48:58 +1000 (EST) Received: from localhost ([::1]:38482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbu80-0008Gx-0y for incoming@patchwork.ozlabs.org; Tue, 05 Jun 2012 09:48:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbu7o-0008Fq-HL for qemu-devel@nongnu.org; Tue, 05 Jun 2012 09:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sbu7e-0007YV-Ny for qemu-devel@nongnu.org; Tue, 05 Jun 2012 09:48:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sbu7e-0007YK-Fw for qemu-devel@nongnu.org; Tue, 05 Jun 2012 09:48:34 -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 q55DmWmc014314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 5 Jun 2012 09:48:32 -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 q55DmTaP023197; Tue, 5 Jun 2012 09:48:31 -0400 From: Pavel Hrdina To: qemu-devel@nongnu.org Date: Tue, 5 Jun 2012 15:48:29 +0200 Message-Id: <9349989e1c2f12d5d6bc00089efdb7947fdf8dac.1338903679.git.phrdina@redhat.com> 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: kwolf@redhat.com, mtosatti@redhat.com, armbru@redhat.com, Pavel Hrdina Subject: [Qemu-devel] [PATCH] fdc: fix media change detection for windows 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 instalation. We have to also check the 'media_change' bit in the 'fd_seek'. Signed-off-by: Pavel Hrdina --- hw/fdc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 30d34e3..70b0c00 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -128,7 +128,8 @@ static int fd_seek(FDrive *drv, uint8_t head, uint8_t track, uint8_t sect, int ret; if (track > drv->max_track || - (head != 0 && (drv->flags & FDISK_DBL_SIDES) == 0)) { + (head != 0 && (drv->flags & FDISK_DBL_SIDES) == 0) || + drv->media_changed) { FLOPPY_DPRINTF("try to read %d %02x %02x (max=%d %d %02x %02x)\n", head, track, sect, 1, (drv->flags & FDISK_DBL_SIDES) == 0 ? 0 : 1,