qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH] qcow2: fix iovec size at qcow2_co_pwritev_compresse


From: Pavel Butsykin
Subject: [Qemu-block] [PATCH] qcow2: fix iovec size at qcow2_co_pwritev_compressed
Date: Mon, 15 Aug 2016 12:39:22 +0300

Use bytes as the size would be more exact than s->cluster_size.  Although
qemu_iovec_to_buf() will not allow to go beyond the qiov.

Signed-off-by: Pavel Butsykin <address@hidden>
---
 block/qcow2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index adf4514..c079aa8 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2565,7 +2565,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, 
uint64_t offset,
         /* Zero-pad last write if image size is not cluster aligned */
         memset(buf + bytes, 0, s->cluster_size - bytes);
     }
-    qemu_iovec_to_buf(qiov, 0, buf, s->cluster_size);
+    qemu_iovec_to_buf(qiov, 0, buf, bytes);
 
     out_buf = g_malloc(s->cluster_size);
 
-- 
2.8.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]