diff mbox

[5/7] ide: also reset io_buffer_index for writes

Message ID 20101210150125.GE31114@lst.de
State New
Headers show

Commit Message

Christoph Hellwig Dec. 10, 2010, 3:01 p.m. UTC
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 <hch@lst.de>
diff mbox

Patch

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;