The goal of the patch-set is to enable qcow2 to use zstd compression for clusters. ZSTD provides better (de)compression performance than currently used ZLIB. Using it will improve perforamnce (reduce compression time) when the compressed clusters is used, e.g backup scenarios.
Also, the patch-set extends qcow2 specification by adding compression_type feature. The feature enables adding ZSTD and another compression algorithms in the future. Here is some measurements ZSTD vs ZLIB: The test: Test compresses and decompresses qemu qcow2 image with just installed rhel-7.6 guest. Image cluster size: 64K. Image on disk size: 2.2G The test was conducted with brd disk to reduce the influence of disk subsystem to the test results. The results is given in seconds. compress cmd: time ./qemu-img convert -O qcow2 -c -o compression_type=[zlib|zstd] src.img [zlib|zstd]_compressed.img decompress cmd time ./qemu-img convert -O qcow2 [zlib|zstd]_compressed.img uncompressed.img The results: compression decompression zlib zstd zlib zstd ------------------------------------------------------------ real 65.5 16.3 (-75 %) 1.9 1.6 (-16 %) user 65.0 15.8 5.3 2.5 sys 3.3 0.2 2.0 2.0 Both ZLIB and ZSTD gave the same compression ratio: ~1.5 compressed image size in both cases: ~1.4G Denis Plotnikov (3): qcow2: introduce compression type feature qcow2: add compression type processing qcow2: add zstd cluster compression block/qcow2.c | 240 ++++++++++++++++++++++++++++++++++++-- block/qcow2.h | 29 +++-- configure | 26 +++++ docs/interop/qcow2.txt | 37 +++++- include/block/block_int.h | 1 + qapi/block-core.json | 34 +++++- 6 files changed, 348 insertions(+), 19 deletions(-) -- 2.17.0