From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya5ei-0005CZ-5Y for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:56:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya5ed-00037F-7N for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:56:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya5ed-00037B-1K for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:56:43 -0400 From: John Snow Date: Mon, 23 Mar 2015 12:56:35 -0400 Message-Id: <1427129798-21590-2-git-send-email-jsnow@redhat.com> In-Reply-To: <1427129798-21590-1-git-send-email-jsnow@redhat.com> References: <1427129798-21590-1-git-send-email-jsnow@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/4] ide: fix cmd_write_pio when nsectors > 1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jsnow@redhat.com We need to adjust the sector being written to prior to calling ide_transfer_start, otherwise we'll write to the same sector again. Signed-off-by: John Snow Reviewed-by: Stefan Hajnoczi Tested-by: Andreas F=C3=A4rber Message-id: 1426811056-2202-2-git-send-email-jsnow@redhat.com --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index ef52f35..0e9da64 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -846,6 +846,7 @@ static void ide_sector_write_cb(void *opaque, int ret= ) s->nsector -=3D n; s->io_buffer_offset +=3D 512 * n; =20 + ide_set_sector(s, ide_get_sector(s) + n); if (s->nsector =3D=3D 0) { /* no more sectors to write */ ide_transfer_stop(s); @@ -857,7 +858,6 @@ static void ide_sector_write_cb(void *opaque, int ret= ) ide_transfer_start(s, s->io_buffer, n1 * BDRV_SECTOR_SIZE, ide_sector_write); } - ide_set_sector(s, ide_get_sector(s) + n); =20 if (win2k_install_hack && ((++s->irq_count % 16) =3D=3D 0)) { /* It seems there is a bug in the Windows 2000 installer HDD --=20 2.1.0