]> Git Repo - qemu.git/commitdiff
qcow2: fix iovec size at qcow2_co_pwritev_compressed
authorPavel Butsykin <[email protected]>
Mon, 15 Aug 2016 09:39:22 +0000 (12:39 +0300)
committerKevin Wolf <[email protected]>
Mon, 5 Sep 2016 17:06:48 +0000 (19:06 +0200)
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 <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/qcow2.c

index adf451491f67327e33d400b443b69ba03f1c0afb..c079aa83b66a29d8c041a538952237c3e0fe7a16 100644 (file)
@@ -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);
 
This page took 0.025198 seconds and 4 git commands to generate.