From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47496 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4TP-0001Nf-JY for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR4TO-0003pV-4a for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:27 -0500 Received: from verein.lst.de ([213.95.11.210]:55202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR4TN-0003pC-Qw for qemu-devel@nongnu.org; Fri, 10 Dec 2010 10:01:26 -0500 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id oBAF1P88031181 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 10 Dec 2010 16:01:25 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-7.2) id oBAF1PGZ031180 for qemu-devel@nongnu.org; Fri, 10 Dec 2010 16:01:25 +0100 Date: Fri, 10 Dec 2010 16:01:25 +0100 From: Christoph Hellwig Message-ID: <20101210150125.GE31114@lst.de> References: <20101210150038.GA30990@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101210150038.GA30990@lst.de> Subject: [Qemu-devel] [PATCH 5/7] ide: also reset io_buffer_index for writes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Currenly the code only resets the io_buffer_index field for reads, but the code seems to expect this for all types of I/O. I guess we simply don't hit large enough transfers that would require this often enough. Signed-off-by: Christoph Hellwig Index: qemu/hw/ide/core.c =================================================================== --- qemu.orig/hw/ide/core.c 2010-12-10 11:35:23.164005731 +0100 +++ qemu/hw/ide/core.c 2010-12-10 11:35:30.471253949 +0100 @@ -605,8 +605,7 @@ static void ide_dma_cb(void *opaque, int /* launch next transfer */ n = s->nsector; - if (s->is_read) - s->io_buffer_index = 0; + s->io_buffer_index = 0; s->io_buffer_size = n * 512; if (dma_buf_prepare(bm, s->is_read) == 0) goto eot;