aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPavel Butsykin <pbutsykin@virtuozzo.com>2016-08-15 12:39:22 +0300
committerKevin Wolf <kwolf@redhat.com>2016-09-05 19:06:48 +0200
commit8b2bd09338ae44e35a46e324cda566dbf17fc21c (patch)
treec4788325c359ff8c0f2292604298dec4bfb0aefd /block
parent980e66216ffc3e37903f979e02c5f63152b518c3 (diff)
qcow2: fix iovec size at qcow2_co_pwritev_compressed
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 <pbutsykin@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index adf451491f..c079aa83b6 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);