Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGLYf-0001o0-0l for qemu-devel@nongnu.org; Sun, 11 Feb 2007 15:44:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGLYd-0001n0-M0 for qemu-devel@nongnu.org; Sun, 11 Feb 2007 15:44:24 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGLYd-0001mv-BI for qemu-devel@nongnu.org; Sun, 11 Feb 2007 15:44:23 -0500 Received: from tapir.sajinet.com.pe ([66.139.79.212]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGLYc-0006tR-St for qemu-devel@nongnu.org; Sun, 11 Feb 2007 15:44:23 -0500 Date: Sun, 11 Feb 2007 14:58:07 -0600 From: Carlo Marcelo Arenas Belon Message-ID: <20070211205807.GA12406@tapir.sajinet.com.pe> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] allow disabling IDE block mode Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, the following patch changes the logic for the processing of WIN_SETMULT so that setting it to 0 (off) is a valid operation as shown by (running Linux on qemu) # hdparm -m0 /dev/hda /dev/hda: setting multcount to 0 multcount = 0 (off) this is specially visible while running Ubuntu Linux 6.06 (dapper) on qemu as it by default disables multmode at boot resulting in the following error : hda: set_multmode: status=0x41 { DriveReady Error } hda: set_multmode: error=0x04 { DriveStatusError } ide: failed opcode was: 0xef Carlo --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu-disable-multsect.patch" Index: hw/ide.c =================================================================== RCS file: /sources/qemu/qemu/hw/ide.c,v retrieving revision 1.53 diff -u -r1.53 ide.c --- hw/ide.c 24 Jan 2007 21:35:22 -0000 1.53 +++ hw/ide.c 11 Feb 2007 20:32:24 -0000 @@ -1631,9 +1631,8 @@ ide_set_irq(s); break; case WIN_SETMULT: - if (s->nsector > MAX_MULT_SECTORS || - s->nsector == 0 || - (s->nsector & (s->nsector - 1)) != 0) { + if (s->nsector != 0 && (s->nsector > MAX_MULT_SECTORS || + (s->nsector & (s->nsector - 1)) != 0)) { ide_abort_command(s); } else { s->mult_sectors = s->nsector; --EeQfGwPcQSOJBaQU--