this adds a create option for QCOW2 images to specify the compression algorithm for compressed clusters. The series adds 3 algorithms to choose from: zlib (default), zlib-fast and lzo. zlib-fast optimizes the zlib parameters without the need for an additional compression library. lzo is choosen as we already link against it and its widely available. Further libraries like zstd are in preparation.
Compression time vs. size of an uncompressed Debian 9 QCOW2 image (size 1148MB): zlib 35.7s 339MB zlib-fast 12.8s 348MB lzo 4.2s 429MB Peter Lieven (4): block/qcow2: add compression_algorithm create option block/qcow2: optimize qcow2_co_pwritev_compressed block/qcow2: add lzo compression algorithm block/qcow2: add zlib-fast compression algorithm block/qcow2-cluster.c | 66 ++++++++++------ block/qcow2.c | 186 +++++++++++++++++++++++++++++++++++++--------- block/qcow2.h | 22 ++++-- configure | 2 +- docs/interop/qcow2.txt | 8 +- include/block/block_int.h | 35 ++++----- qemu-img.texi | 12 +++ 7 files changed, 251 insertions(+), 80 deletions(-) -- 1.9.1
