05.07.2021 12:15, Vladimir Sementsov-Ogievskiy wrote:
Instead of qemu_img_log("info", ..) use generic helper img_info_log().

img_info_log() has smarter logic. For example it use filter_img_info()
to filter output, which in turns filter a compression type. So it will
help us in future when we implement a possibility to use zstd
compression by default (with help of some runtime config file or maybe
build option). For now to test you should recompile qemu with a small
patch:

     --- a/block/qcow2.c
     +++ b/block/qcow2.c
     @@ -3540,6 +3540,11 @@ qcow2_co_create(BlockdevCreateOptions 
*create_options, Error **errp)
              }
          }

     +    if (!qcow2_opts->has_compression_type && version >= 3) {
     +        qcow2_opts->has_compression_type = true;
     +        qcow2_opts->compression_type = QCOW2_COMPRESSION_TYPE_ZSTD;
     +    }
     +
          if (qcow2_opts->has_compression_type &&
              qcow2_opts->compression_type != QCOW2_COMPRESSION_TYPE_ZLIB) {

Signed-off-by: Vladimir Sementsov-Ogievskiy<vsement...@virtuozzo.com>

Wow, that was bad idea to insert patch into commit message even with indent: it 
breaks rpm build for me.

So, reword like this:

    build option). For now to test you should recompile qemu with a small
    addition into block/qcow2.c before
      "if (qcow2_opts->has_compression_type":
if (!qcow2_opts->has_compression_type && version >= 3) {
            qcow2_opts->has_compression_type = true;
            qcow2_opts->compression_type = QCOW2_COMPRESSION_TYPE_ZSTD;
        }


--
Best regards,
Vladimir

Reply via email to