aboutsummaryrefslogtreecommitdiff
path: root/block/block-copy.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-10-29 18:09:34 +0300
committerMax Reitz <mreitz@redhat.com>2019-11-04 09:21:45 +0100
commitdcfbece68441bfbe6803de60ab5a8045196094b4 (patch)
tree63dcde0cd0cd01c57caab4d6329dfb9a83e87386 /block/block-copy.c
parent407d22eb5b5f9eeb75e450ef52c84e202b170838 (diff)
downloadqemu-dcfbece68441bfbe6803de60ab5a8045196094b4.zip
qemu-dcfbece68441bfbe6803de60ab5a8045196094b4.tar.gz
qemu-dcfbece68441bfbe6803de60ab5a8045196094b4.tar.bz2
block/block-copy: fix s->copy_size for compressed cluster
0e2402452f1f20429 allowed writes larger than cluster, but that's unsupported for compressed write. Fix it. Fixes: 0e2402452f1f20429 Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20191029150934.26416-1-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/block-copy.c')
-rw-r--r--block/block-copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/block-copy.c b/block/block-copy.c
index c39cc9c..79798a1 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -109,9 +109,9 @@ BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target,
s->use_copy_range = false;
s->copy_size = cluster_size;
} else if (write_flags & BDRV_REQ_WRITE_COMPRESSED) {
- /* Compression is not supported for copy_range */
+ /* Compression supports only cluster-size writes and no copy-range. */
s->use_copy_range = false;
- s->copy_size = MAX(cluster_size, BLOCK_COPY_MAX_BUFFER);
+ s->copy_size = cluster_size;
} else {
/*
* copy_range does not respect max_transfer (it's a TODO), so we factor