summaryrefslogtreecommitdiff
path: root/qemu-img.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-05-06 21:08:43 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-05-09 13:32:16 +0200
commit85f49cad879adfb5c3cbdc47ca3c3b50eb8f40bc (patch)
tree1600d9060ee2ffebfa8b95af4f4338aaf1896fc1 /qemu-img.c
parentec209aca8340be1c81afe13fbe0ba135e5d3b9f4 (diff)
downloadqemu-85f49cad879adfb5c3cbdc47ca3c3b50eb8f40bc.tar.gz
qemu-img: Convert by cluster size if target is compressed
If target block driver forces compression, qemu-img convert needs to write by cluster size as well as "-c" option. Particularly, this applies for converting to VMDK streamOptimized format. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 317bc6c1cd..04ce02aeb4 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1502,6 +1502,7 @@ static int img_convert(int argc, char **argv)
goto out;
}
} else {
+ compress = compress || bdi.needs_compressed_writes;
cluster_sectors = bdi.cluster_size / BDRV_SECTOR_SIZE;
}