Patchwork [4/8] win32-aio: Fix vectored reads

login
register
mail settings
Submitter Stefan Hajnoczi
Date Jan. 18, 2013, 4:28 p.m.
Message ID <1358526521-24300-5-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/213685/
State New
Headers show

Comments

Stefan Hajnoczi - Jan. 18, 2013, 4:28 p.m.
From: Kevin Wolf <kwolf@redhat.com>

Copying data in the right direction really helps a lot!

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/win32-aio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/block/win32-aio.c b/block/win32-aio.c
index 0383370..e4b7b75 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -84,7 +84,7 @@  static void win32_aio_process_completion(QEMUWin32AIOState *s,
             int i;
 
             for (i = 0; i < qiov->niov; ++i) {
-                memcpy(p, qiov->iov[i].iov_base, qiov->iov[i].iov_len);
+                memcpy(qiov->iov[i].iov_base, p, qiov->iov[i].iov_len);
                 p += qiov->iov[i].iov_len;
             }
             qemu_vfree(waiocb->buf);