From nobody Sat May 18 21:00:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1588840117; cv=none; d=zohomail.com; s=zohoarc; b=VhgT/q4SNRgVVUGHLcfjbqBYcALMwzO6/fV4uXjiUcnlwWA3R1ix7Jj+xMGC9tHizlMlnLFx6ViW5J5VONVd0ZmvqR1yik3NBINEMYkJ2TVzwkS/9SZlc/ShRjKl07WI3HejeAp1GaiLE+HXCGDKHmYvjFbj7jiJ1dnC+Dtwdkg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588840117; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=bH/JmAWwetS+6eYfbW63R+bFrMqeiQLy3dkMdvIspIs=; b=D2krUjUVK3Sl8k6mt+5d1AJeN36bhWiFqRzJdKDX6zXqUAnRaaHqwYB5Mhal1LXHRVjyIqI44HhYObZD+J8D4wMPAXwRq/4ReUmmDVZ+TPaa5GKQc0m6rqkMbwpJjwBIjXid8l75UlcMIWN3QRbCdRRrsGi+NALerSDVD5k840E= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588840117537168.83061954319533; Thu, 7 May 2020 01:28:37 -0700 (PDT) Received: from localhost ([::1]:34242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbtT-0001Y7-UL for importer@patchew.org; Thu, 07 May 2020 04:28:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbqs-00061H-I1; Thu, 07 May 2020 04:25:54 -0400 Received: from relay.sw.ru ([185.231.240.75]:37754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbql-0004mZ-Ta; Thu, 07 May 2020 04:25:53 -0400 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jWbqa-00024P-JF; Thu, 07 May 2020 11:25:36 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v24 1/4] qcow2: introduce compression type feature Date: Thu, 7 May 2020 11:25:18 +0300 Message-Id: <20200507082521.29210-2-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200507082521.29210-1-dplotnikov@virtuozzo.com> References: <20200507082521.29210-1-dplotnikov@virtuozzo.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.231.240.75; envelope-from=dplotnikov@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 04:25:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The patch adds some preparation parts for incompatible compression type feature to qcow2 allowing the use different compression methods for image clusters (de)compressing. It is implied that the compression type is set on the image creation and can be changed only later by image conversion, thus compression type defines the only compression algorithm used for the image, and thus, for all image clusters. The goal of the feature is to add support of other compression methods to qcow2. For example, ZSTD which is more effective on compression than ZLI= B. The default compression is ZLIB. Images created with ZLIB compression type are backward compatible with older qemu versions. Adding of the compression type breaks a number of tests because now the compression type is reported on image creation and there are some changes in the qcow2 header in size and offsets. The tests are fixed in the following ways: * filter out compression_type for many tests * fix header size, feature table size and backing file offset affected tests: 031, 036, 061, 080 header_size +=3D8: 1 byte compression type 7 bytes padding feature_table +=3D 48: incompatible feature compression type backing_file_offset +=3D 56 (8 + 48 -> header_change + feature_table_= change) * add "compression type" for test output matching when it isn't filtered affected tests: 049, 060, 061, 065, 082, 085, 144, 182, 185, 198, 206, 242, 255, 274, 280 Signed-off-by: Denis Plotnikov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake Reviewed-by: Max Reitz QAPI part: Acked-by: Markus Armbruster --- qapi/block-core.json | 22 +++++- block/qcow2.h | 20 +++++- include/block/block_int.h | 1 + block/qcow2.c | 113 +++++++++++++++++++++++++++++++ tests/qemu-iotests/031.out | 14 ++-- tests/qemu-iotests/036.out | 4 +- tests/qemu-iotests/049.out | 102 ++++++++++++++-------------- tests/qemu-iotests/060.out | 1 + tests/qemu-iotests/061.out | 34 ++++++---- tests/qemu-iotests/065 | 28 +++++--- tests/qemu-iotests/080 | 2 +- tests/qemu-iotests/082.out | 48 +++++++++++-- tests/qemu-iotests/085.out | 38 +++++------ tests/qemu-iotests/144.out | 4 +- tests/qemu-iotests/182.out | 2 +- tests/qemu-iotests/185.out | 8 +-- tests/qemu-iotests/198.out | 2 + tests/qemu-iotests/206.out | 5 ++ tests/qemu-iotests/242.out | 5 ++ tests/qemu-iotests/255.out | 8 +-- tests/qemu-iotests/274.out | 49 +++++++------- tests/qemu-iotests/280.out | 2 +- tests/qemu-iotests/common.filter | 3 +- 23 files changed, 365 insertions(+), 150 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 943df1926a..1522e2983f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -78,6 +78,8 @@ # # @bitmaps: A list of qcow2 bitmap details (since 4.0) # +# @compression-type: the image cluster compression method (since 5.1) +# # Since: 1.7 ## { 'struct': 'ImageInfoSpecificQCow2', @@ -89,7 +91,8 @@ '*corrupt': 'bool', 'refcount-bits': 'int', '*encrypt': 'ImageInfoSpecificQCow2Encryption', - '*bitmaps': ['Qcow2BitmapInfo'] + '*bitmaps': ['Qcow2BitmapInfo'], + 'compression-type': 'Qcow2CompressionType' } } =20 ## @@ -4284,6 +4287,18 @@ 'data': [ 'v2', 'v3' ] } =20 =20 +## +# @Qcow2CompressionType: +# +# Compression type used in qcow2 image file +# +# @zlib: zlib compression, see +# +# Since: 5.1 +## +{ 'enum': 'Qcow2CompressionType', + 'data': [ 'zlib' ] } + ## # @BlockdevCreateOptionsQcow2: # @@ -4307,6 +4322,8 @@ # allowed values: off, falloc, full, metadata) # @lazy-refcounts: True if refcounts may be updated lazily (default: off) # @refcount-bits: Width of reference counts in bits (default: 16) +# @compression-type: The image cluster compression method +# (default: zlib, since 5.1) # # Since: 2.12 ## @@ -4322,7 +4339,8 @@ '*cluster-size': 'size', '*preallocation': 'PreallocMode', '*lazy-refcounts': 'bool', - '*refcount-bits': 'int' } } + '*refcount-bits': 'int', + '*compression-type':'Qcow2CompressionType' } } =20 ## # @BlockdevCreateOptionsQed: diff --git a/block/qcow2.h b/block/qcow2.h index f4de0a27d5..6a8b82e6cc 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -146,8 +146,16 @@ typedef struct QCowHeader { =20 uint32_t refcount_order; uint32_t header_length; + + /* Additional fields */ + uint8_t compression_type; + + /* header must be a multiple of 8 */ + uint8_t padding[7]; } QEMU_PACKED QCowHeader; =20 +QEMU_BUILD_BUG_ON(!QEMU_IS_ALIGNED(sizeof(QCowHeader), 8)); + typedef struct QEMU_PACKED QCowSnapshotHeader { /* header is 8 byte aligned */ uint64_t l1_table_offset; @@ -216,13 +224,16 @@ enum { QCOW2_INCOMPAT_DIRTY_BITNR =3D 0, QCOW2_INCOMPAT_CORRUPT_BITNR =3D 1, QCOW2_INCOMPAT_DATA_FILE_BITNR =3D 2, + QCOW2_INCOMPAT_COMPRESSION_BITNR =3D 3, QCOW2_INCOMPAT_DIRTY =3D 1 << QCOW2_INCOMPAT_DIRTY_BITNR, QCOW2_INCOMPAT_CORRUPT =3D 1 << QCOW2_INCOMPAT_CORRUPT_BITNR, QCOW2_INCOMPAT_DATA_FILE =3D 1 << QCOW2_INCOMPAT_DATA_FILE_BITN= R, + QCOW2_INCOMPAT_COMPRESSION =3D 1 << QCOW2_INCOMPAT_COMPRESSION_BI= TNR, =20 QCOW2_INCOMPAT_MASK =3D QCOW2_INCOMPAT_DIRTY | QCOW2_INCOMPAT_CORRUPT - | QCOW2_INCOMPAT_DATA_FILE, + | QCOW2_INCOMPAT_DATA_FILE + | QCOW2_INCOMPAT_COMPRESSION, }; =20 /* Compatible feature bits */ @@ -366,6 +377,13 @@ typedef struct BDRVQcow2State { =20 bool metadata_preallocation_checked; bool metadata_preallocation; + /* + * Compression type used for the image. Default: 0 - ZLIB + * The image compression type is set on image creation. + * For now, the only way to change the compression type + * is to convert the image with the desired compression type set. + */ + Qcow2CompressionType compression_type; } BDRVQcow2State; =20 typedef struct Qcow2COWRegion { diff --git a/include/block/block_int.h b/include/block/block_int.h index 92335f33c7..6821ad8e96 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -57,6 +57,7 @@ #define BLOCK_OPT_REFCOUNT_BITS "refcount_bits" #define BLOCK_OPT_DATA_FILE "data_file" #define BLOCK_OPT_DATA_FILE_RAW "data_file_raw" +#define BLOCK_OPT_COMPRESSION_TYPE "compression_type" =20 #define BLOCK_PROBE_BUF_SIZE 512 =20 diff --git a/block/qcow2.c b/block/qcow2.c index 2ba0b17c39..a5587de1d2 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1242,6 +1242,39 @@ static int qcow2_update_options(BlockDriverState *bs= , QDict *options, return ret; } =20 +static int validate_compression_type(BDRVQcow2State *s, Error **errp) +{ + switch (s->compression_type) { + case QCOW2_COMPRESSION_TYPE_ZLIB: + break; + + default: + error_setg(errp, "qcow2: unknown compression type: %u", + s->compression_type); + return -ENOTSUP; + } + + /* + * if the compression type differs from QCOW2_COMPRESSION_TYPE_ZLIB + * the incompatible feature flag must be set + */ + if (s->compression_type =3D=3D QCOW2_COMPRESSION_TYPE_ZLIB) { + if (s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION) { + error_setg(errp, "qcow2: Compression type incompatible feature= " + "bit must not be set"); + return -EINVAL; + } + } else { + if (!(s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION)) { + error_setg(errp, "qcow2: Compression type incompatible feature= " + "bit must be set"); + return -EINVAL; + } + } + + return 0; +} + /* Called with s->lock held. */ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) @@ -1357,6 +1390,23 @@ static int coroutine_fn qcow2_do_open(BlockDriverSta= te *bs, QDict *options, s->compatible_features =3D header.compatible_features; s->autoclear_features =3D header.autoclear_features; =20 + /* + * Handle compression type + * Older qcow2 images don't contain the compression type header. + * Distinguish them by the header length and use + * the only valid (default) compression type in that case + */ + if (header.header_length > offsetof(QCowHeader, compression_type)) { + s->compression_type =3D header.compression_type; + } else { + s->compression_type =3D QCOW2_COMPRESSION_TYPE_ZLIB; + } + + ret =3D validate_compression_type(s, errp); + if (ret) { + goto fail; + } + if (s->incompatible_features & ~QCOW2_INCOMPAT_MASK) { void *feature_table =3D NULL; qcow2_read_extensions(bs, header.header_length, ext_end, @@ -2728,6 +2778,11 @@ int qcow2_update_header(BlockDriverState *bs) total_size =3D bs->total_sectors * BDRV_SECTOR_SIZE; refcount_table_clusters =3D s->refcount_table_size >> (s->cluster_bits= - 3); =20 + ret =3D validate_compression_type(s, NULL); + if (ret) { + goto fail; + } + *header =3D (QCowHeader) { /* Version 2 fields */ .magic =3D cpu_to_be32(QCOW_MAGIC), @@ -2750,6 +2805,7 @@ int qcow2_update_header(BlockDriverState *bs) .autoclear_features =3D cpu_to_be64(s->autoclear_features), .refcount_order =3D cpu_to_be32(s->refcount_order), .header_length =3D cpu_to_be32(header_length), + .compression_type =3D s->compression_type, }; =20 /* For older versions, write a shorter header */ @@ -2849,6 +2905,11 @@ int qcow2_update_header(BlockDriverState *bs) .bit =3D QCOW2_INCOMPAT_DATA_FILE_BITNR, .name =3D "external data file", }, + { + .type =3D QCOW2_FEAT_TYPE_INCOMPATIBLE, + .bit =3D QCOW2_INCOMPAT_COMPRESSION_BITNR, + .name =3D "compression type", + }, { .type =3D QCOW2_FEAT_TYPE_COMPATIBLE, .bit =3D QCOW2_COMPAT_LAZY_REFCOUNTS_BITNR, @@ -3287,6 +3348,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options= , Error **errp) uint64_t* refcount_table; Error *local_err =3D NULL; int ret; + uint8_t compression_type =3D QCOW2_COMPRESSION_TYPE_ZLIB; =20 assert(create_options->driver =3D=3D BLOCKDEV_DRIVER_QCOW2); qcow2_opts =3D &create_options->u.qcow2; @@ -3404,6 +3466,27 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) } } =20 + if (qcow2_opts->has_compression_type && + qcow2_opts->compression_type !=3D QCOW2_COMPRESSION_TYPE_ZLIB) { + + ret =3D -EINVAL; + + if (version < 3) { + error_setg(errp, "Non-zlib compression type is only supported = with " + "compatibility level 1.1 and above (use version=3Dv= 3 or " + "greater)"); + goto out; + } + + switch (qcow2_opts->compression_type) { + default: + error_setg(errp, "Unknown compression type"); + goto out; + } + + compression_type =3D qcow2_opts->compression_type; + } + /* Create BlockBackend to write to the image */ blk =3D blk_new(bdrv_get_aio_context(bs), BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL); @@ -3426,6 +3509,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options= , Error **errp) .refcount_table_offset =3D cpu_to_be64(cluster_size), .refcount_table_clusters =3D cpu_to_be32(1), .refcount_order =3D cpu_to_be32(refcount_order), + /* don't deal with endianness since compression_type is 1 byte lon= g */ + .compression_type =3D compression_type, .header_length =3D cpu_to_be32(sizeof(*header)), }; =20 @@ -3444,6 +3529,10 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) header->autoclear_features |=3D cpu_to_be64(QCOW2_AUTOCLEAR_DATA_FILE_RAW); } + if (compression_type !=3D QCOW2_COMPRESSION_TYPE_ZLIB) { + header->incompatible_features |=3D + cpu_to_be64(QCOW2_INCOMPAT_COMPRESSION); + } =20 ret =3D blk_pwrite(blk, 0, header, cluster_size, 0); g_free(header); @@ -3629,6 +3718,7 @@ static int coroutine_fn qcow2_co_create_opts(BlockDri= ver *drv, { BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT }, { BLOCK_OPT_COMPAT_LEVEL, "version" }, { BLOCK_OPT_DATA_FILE_RAW, "data-file-raw" }, + { BLOCK_OPT_COMPRESSION_TYPE, "compression-type" }, { NULL, NULL }, }; =20 @@ -4914,6 +5004,7 @@ static ImageInfoSpecific *qcow2_get_specific_info(Blo= ckDriverState *bs, .data_file =3D g_strdup(s->image_data_file), .has_data_file_raw =3D has_data_file(bs), .data_file_raw =3D data_file_is_raw(bs), + .compression_type =3D s->compression_type, }; } else { /* if this assertion fails, this probably means a new version was @@ -5303,6 +5394,22 @@ static int qcow2_amend_options(BlockDriverState *bs,= QemuOpts *opts, "images"); return -EINVAL; } + } else if (!strcmp(desc->name, BLOCK_OPT_COMPRESSION_TYPE)) { + const char *ct_name =3D + qemu_opt_get(opts, BLOCK_OPT_COMPRESSION_TYPE); + int compression_type =3D + qapi_enum_parse(&Qcow2CompressionType_lookup, ct_name, -1, + NULL); + if (compression_type =3D=3D -1) { + error_setg(errp, "Unknown compression type: %s", ct_name); + return -ENOTSUP; + } + + if (compression_type !=3D s->compression_type) { + error_setg(errp, "Changing the compression type " + "is not supported"); + return -ENOTSUP; + } } else { /* if this point is reached, this probably means a new option = was * added without having it covered here */ @@ -5571,6 +5678,12 @@ static QemuOptsList qcow2_create_opts =3D { .help =3D "Width of a reference count entry in bits", .def_value_str =3D "16" }, + { + .name =3D BLOCK_OPT_COMPRESSION_TYPE, + .type =3D QEMU_OPT_STRING, + .help =3D "Compression method used for image cluster compressi= on", + .def_value_str =3D "zlib" + }, { /* end of list */ } } }; diff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out index 46f97c5a4e..5a4beda6a2 100644 --- a/tests/qemu-iotests/031.out +++ b/tests/qemu-iotests/031.out @@ -113,11 +113,11 @@ incompatible_features [] compatible_features [] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 Header extension: @@ -146,11 +146,11 @@ incompatible_features [] compatible_features [] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 Header extension: @@ -164,7 +164,7 @@ No errors were found on the image. =20 magic 0x514649fb version 3 -backing_file_offset 0x1d8 +backing_file_offset 0x210 backing_file_size 0x17 cluster_bits 16 size 67108864 @@ -179,7 +179,7 @@ incompatible_features [] compatible_features [] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0xe2792aca @@ -188,7 +188,7 @@ data 'host_device' =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 Header extension: diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index 23b699ce06..e409acf60e 100644 --- a/tests/qemu-iotests/036.out +++ b/tests/qemu-iotests/036.out @@ -26,7 +26,7 @@ compatible_features [] autoclear_features [63] Header extension: magic 0x6803f857 -length 288 +length 336 data =20 =20 @@ -38,7 +38,7 @@ compatible_features [] autoclear_features [] Header extension: magic 0x6803f857 -length 288 +length 336 data =20 *** done diff --git a/tests/qemu-iotests/049.out b/tests/qemu-iotests/049.out index affa55b341..a5cfba1756 100644 --- a/tests/qemu-iotests/049.out +++ b/tests/qemu-iotests/049.out @@ -4,90 +4,90 @@ QA output created by 049 =3D=3D 1. Traditional size parameter =3D=3D =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1048576 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1048576 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1073741824 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1073741824 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1099511627776 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1099511627776 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1572864 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1572864 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1610612736 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1610612736 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1649267441664 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1649267441664 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 =3D=3D 2. Specifying size via -o =3D=3D =20 qemu-img create -f qcow2 -o size=3D1024 TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1024b TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1k TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1K TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1M TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1048576 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1048576 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1G TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1073741824 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1073741824 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1T TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1099511627776 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1099511627776 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1024.0 TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1024.0b TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1024 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1.5k TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1.5K TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1536 cluster_size=3D6553= 6 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1.5M TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1572864 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1572864 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1.5G TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1610612736 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1610612736 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o size=3D1.5T TEST_DIR/t.qcow2 -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1649267441664 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D1649267441664 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 =3D=3D 3. Invalid sizes =3D=3D =20 @@ -129,84 +129,84 @@ qemu-img: TEST_DIR/t.qcow2: The image size must be sp= ecified only once =3D=3D Check correct interpretation of suffixes for cluster size =3D=3D =20 qemu-img create -f qcow2 -o cluster_size=3D1024 TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1024b TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1k TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1K TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1M TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1048576 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1048576 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1024.0 TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D1024.0b TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 1024 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D0.5k TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 512 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 512 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D0.5K TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 512 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 512 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 qemu-img create -f qcow2 -o cluster_size=3D0.5M TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 524288 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 524288 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 =3D=3D Check compat level option =3D=3D =20 qemu-img create -f qcow2 -o compat=3D0.10 TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_typ= e=3Dzlib =20 qemu-img create -f qcow2 -o compat=3D1.1 TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type= =3Dzlib =20 qemu-img create -f qcow2 -o compat=3D0.42 TEST_DIR/t.qcow2 64M qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42' -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.42 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.42 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_typ= e=3Dzlib =20 qemu-img create -f qcow2 -o compat=3Dfoobar TEST_DIR/t.qcow2 64M qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar' -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3Dfoobar= cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3Dfoobar= cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_t= ype=3Dzlib =20 =3D=3D Check preallocation option =3D=3D =20 qemu-img create -f qcow2 -o preallocation=3Doff TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3Doff lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3Doff lazy_refcounts=3Doff refcount_bits=3D16 compressi= on_type=3Dzlib =20 qemu-img create -f qcow2 -o preallocation=3Dmetadata TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3Dmetadata lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3Dmetadata lazy_refcounts=3Doff refcount_bits=3D16 comp= ression_type=3Dzlib =20 qemu-img create -f qcow2 -o preallocation=3D1234 TEST_DIR/t.qcow2 64M qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234' -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3D1234 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 cluster_size=3D= 65536 preallocation=3D1234 lazy_refcounts=3Doff refcount_bits=3D16 compress= ion_type=3Dzlib =20 =3D=3D Check encryption option =3D=3D =20 qemu-img create -f qcow2 -o encryption=3Doff TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 encryption=3Dof= f cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 encryption=3Dof= f cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_= type=3Dzlib =20 qemu-img create -f qcow2 --object secret,id=3Dsec0,data=3D123456 -o encryp= tion=3Don,encrypt.key-secret=3Dsec0 TEST_DIR/t.qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 encryption=3Don= encrypt.key-secret=3Dsec0 cluster_size=3D65536 lazy_refcounts=3Doff refcou= nt_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 encryption=3Don= encrypt.key-secret=3Dsec0 cluster_size=3D65536 lazy_refcounts=3Doff refcou= nt_bits=3D16 compression_type=3Dzlib =20 =3D=3D Check lazy_refcounts option (only with v3) =3D=3D =20 qemu-img create -f qcow2 -o compat=3D1.1,lazy_refcounts=3Doff TEST_DIR/t.q= cow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type= =3Dzlib =20 qemu-img create -f qcow2 -o compat=3D1.1,lazy_refcounts=3Don TEST_DIR/t.qc= ow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Don refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D1.1 cl= uster_size=3D65536 lazy_refcounts=3Don refcount_bits=3D16 compression_type= =3Dzlib =20 qemu-img create -f qcow2 -o compat=3D0.10,lazy_refcounts=3Doff TEST_DIR/t.= qcow2 64M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_typ= e=3Dzlib =20 qemu-img create -f qcow2 -o compat=3D0.10,lazy_refcounts=3Don TEST_DIR/t.q= cow2 64M qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibili= ty level 1.1 and above (use version=3Dv3 or greater) -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Don refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 compat=3D0.10 c= luster_size=3D65536 lazy_refcounts=3Don refcount_bits=3D16 compression_type= =3Dzlib =20 *** done diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index 09caaea865..be5f8707a3 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -17,6 +17,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: true diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index 413cc4e0f4..45c029228c 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -22,11 +22,11 @@ incompatible_features [] compatible_features [0] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 magic 0x514649fb @@ -80,11 +80,11 @@ incompatible_features [] compatible_features [0] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 magic 0x514649fb @@ -136,11 +136,11 @@ incompatible_features [0] compatible_features [0] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 ERROR cluster 5 refcount=3D0 reference=3D1 @@ -191,11 +191,11 @@ incompatible_features [] compatible_features [42] autoclear_features [42] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 magic 0x514649fb @@ -260,11 +260,11 @@ incompatible_features [] compatible_features [0] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 read 65536/65536 bytes at offset 44040192 @@ -294,11 +294,11 @@ incompatible_features [0] compatible_features [0] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 ERROR cluster 5 refcount=3D0 reference=3D1 @@ -323,11 +323,11 @@ incompatible_features [] compatible_features [] autoclear_features [] refcount_order 4 -header_length 104 +header_length 112 =20 Header extension: magic 0x6803f857 -length 288 +length 336 data =20 read 131072/131072 bytes at offset 0 @@ -491,6 +491,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -511,6 +512,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file: foo @@ -524,6 +526,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file raw: false @@ -538,6 +541,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -550,6 +554,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data @@ -563,6 +568,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 data file: TEST_DIR/t.IMGFMT.data diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index 6426474271..18dc488c7a 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -88,24 +88,30 @@ class TestQMP(TestImageInfoSpecific): class TestQCow2(TestQemuImgInfo): '''Testing a qcow2 version 2 image''' img_options =3D 'compat=3D0.10' - json_compare =3D { 'compat': '0.10', 'refcount-bits': 16 } - human_compare =3D [ 'compat: 0.10', 'refcount bits: 16' ] + json_compare =3D { 'compat': '0.10', 'refcount-bits': 16, + 'compression-type': 'zlib' } + human_compare =3D [ 'compat: 0.10', 'compression type: zlib', + 'refcount bits: 16' ] =20 class TestQCow3NotLazy(TestQemuImgInfo): '''Testing a qcow2 version 3 image with lazy refcounts disabled''' img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff' json_compare =3D { 'compat': '1.1', 'lazy-refcounts': False, - 'refcount-bits': 16, 'corrupt': False } - human_compare =3D [ 'compat: 1.1', 'lazy refcounts: false', - 'refcount bits: 16', 'corrupt: false' ] + 'refcount-bits': 16, 'corrupt': False, + 'compression-type': 'zlib' } + human_compare =3D [ 'compat: 1.1', 'compression type: zlib', + 'lazy refcounts: false', 'refcount bits: 16', + 'corrupt: false' ] =20 class TestQCow3Lazy(TestQemuImgInfo): '''Testing a qcow2 version 3 image with lazy refcounts enabled''' img_options =3D 'compat=3D1.1,lazy_refcounts=3Don' json_compare =3D { 'compat': '1.1', 'lazy-refcounts': True, - 'refcount-bits': 16, 'corrupt': False } - human_compare =3D [ 'compat: 1.1', 'lazy refcounts: true', - 'refcount bits: 16', 'corrupt: false' ] + 'refcount-bits': 16, 'corrupt': False, + 'compression-type': 'zlib' } + human_compare =3D [ 'compat: 1.1', 'compression type: zlib', + 'lazy refcounts: true', 'refcount bits: 16', + 'corrupt: false' ] =20 class TestQCow3NotLazyQMP(TestQMP): '''Testing a qcow2 version 3 image with lazy refcounts disabled, openi= ng @@ -113,7 +119,8 @@ class TestQCow3NotLazyQMP(TestQMP): img_options =3D 'compat=3D1.1,lazy_refcounts=3Doff' qemu_options =3D 'lazy-refcounts=3Don' compare =3D { 'compat': '1.1', 'lazy-refcounts': False, - 'refcount-bits': 16, 'corrupt': False } + 'refcount-bits': 16, 'corrupt': False, + 'compression-type': 'zlib' } =20 =20 class TestQCow3LazyQMP(TestQMP): @@ -122,7 +129,8 @@ class TestQCow3LazyQMP(TestQMP): img_options =3D 'compat=3D1.1,lazy_refcounts=3Don' qemu_options =3D 'lazy-refcounts=3Doff' compare =3D { 'compat': '1.1', 'lazy-refcounts': True, - 'refcount-bits': 16, 'corrupt': False } + 'refcount-bits': 16, 'corrupt': False, + 'compression-type': 'zlib' } =20 TestImageInfoSpecific =3D None TestQemuImgInfo =3D None diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080 index a3d13c414e..7588c63b6c 100755 --- a/tests/qemu-iotests/080 +++ b/tests/qemu-iotests/080 @@ -45,7 +45,7 @@ _supported_os Linux # - This is generally a test for compat=3D1.1 images _unsupported_imgopts 'refcount_bits=3D1[^0-9]' data_file 'compat=3D0.10' =20 -header_size=3D104 +header_size=3D112 =20 offset_backing_file_offset=3D8 offset_backing_file_size=3D16 diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index 9d4ed4dc9d..529a1214e1 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -3,38 +3,40 @@ QA output created by 082 =3D=3D=3D create: Options specified more than once =3D=3D=3D =20 Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 =20 Testing: create -f qcow2 -o cluster_size=3D4k -o lazy_refcounts=3Don TEST_= DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D4096 lazy_refcounts=3Don refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D4096 lazy_refcounts=3Don refcount_bits=3D16 compression_type=3Dzlib image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false =20 Testing: create -f qcow2 -o cluster_size=3D4k -o lazy_refcounts=3Don -o cl= uster_size=3D8k TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D8192 lazy_refcounts=3Don refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D8192 lazy_refcounts=3Don refcount_bits=3D16 compression_type=3Dzlib image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false =20 Testing: create -f qcow2 -o cluster_size=3D4k,cluster_size=3D8k TEST_DIR/t= .qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D8192 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D8192 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 128 MiB (134217728 bytes) @@ -48,6 +50,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -71,6 +74,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -94,6 +98,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -117,6 +122,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -140,6 +146,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -163,6 +170,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -186,6 +194,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -209,6 +218,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -227,10 +237,10 @@ Supported options: size=3D - Virtual disk size =20 Testing: create -f qcow2 -u -o backing_file=3DTEST_DIR/t.qcow2,,help TEST_= DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,help cluster_size=3D65536 lazy_refcounts=3Doff refcoun= t_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,help cluster_size=3D65536 lazy_refcounts=3Doff refcoun= t_bits=3D16 compression_type=3Dzlib =20 Testing: create -f qcow2 -u -o backing_file=3DTEST_DIR/t.qcow2,,? TEST_DIR= /t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,? cluster_size=3D65536 lazy_refcounts=3Doff refcount_b= its=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 backing_file= =3DTEST_DIR/t.qcow2,,? cluster_size=3D65536 lazy_refcounts=3Doff refcount_b= its=3D16 compression_type=3Dzlib =20 Testing: create -f qcow2 -o backing_file=3DTEST_DIR/t.qcow2, -o help TEST_= DIR/t.qcow2 128M qemu-img: Invalid option list: backing_file=3DTEST_DIR/t.qcow2, @@ -247,6 +257,7 @@ Supported qcow2 options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -279,7 +290,7 @@ qemu-img: Format driver 'bochs' does not support image = creation =3D=3D=3D convert: Options specified more than once =3D=3D=3D =20 Testing: create -f qcow2 TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base @@ -299,6 +310,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false @@ -310,6 +322,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false @@ -328,6 +341,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -351,6 +365,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -374,6 +389,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -397,6 +413,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -420,6 +437,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -443,6 +461,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -466,6 +485,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -489,6 +509,7 @@ Supported options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -527,6 +548,7 @@ Supported qcow2 options: backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -579,6 +601,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false @@ -590,6 +613,7 @@ virtual size: 130 MiB (136314880 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -601,6 +625,7 @@ virtual size: 132 MiB (138412032 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 16 corrupt: false @@ -619,6 +644,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -643,6 +669,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -667,6 +694,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -691,6 +719,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -715,6 +744,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -739,6 +769,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -763,6 +794,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -787,6 +819,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm @@ -828,6 +861,7 @@ Creation options for 'qcow2': backing_fmt=3D - Image format of the base image cluster_size=3D - qcow2 cluster size compat=3D - Compatibility level (v2 [0.10] or v3 [1.1]) + compression_type=3D - Compression method used for image cluster com= pression data_file=3D - File name of an external data file data_file_raw=3D - The external data file must stay valid= as a raw image encrypt.cipher-alg=3D - Name of encryption cipher algorithm diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out index fd11aae678..a822ff4ef6 100644 --- a/tests/qemu-iotests/085.out +++ b/tests/qemu-iotests/085.out @@ -13,7 +13,7 @@ Formatting 'TEST_DIR/t.IMGFMT.2', fmt=3DIMGFMT size=3D134= 217728 =3D=3D=3D Create a single snapshot on virtio0 =3D=3D=3D =20 { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } } -Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.1 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.1 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} =20 =3D=3D=3D Invalid command - missing device and nodename =3D=3D=3D @@ -30,40 +30,40 @@ Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=3Dqcow2 = size=3D134217728 backing_file =3D=3D=3D Create several transactional group snapshots =3D=3D=3D =20 { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /2-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/2-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/1-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.2 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/1-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/t.qcow2.2 backing_fmt=3Dqcow2 cluster_size=3D65536 la= zy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /3-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/3-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/2-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /4-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/4-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/3-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /5-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/5-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/4-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /6-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/6-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/5-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /7-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/7-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/6-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /8-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/8-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/7-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /9-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { = 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/9-snapshot-v1.IMGFMT' } } ]= } } -Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 ba= cking_file=3DTEST_DIR/8-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev= -snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR= /10-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : {= 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/10-snapshot-v1.IMGFMT' } }= ] } } -Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 -Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v0.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib +Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=3Dqcow2 size=3D134217728 b= acking_file=3DTEST_DIR/9-snapshot-v1.qcow2 backing_fmt=3Dqcow2 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} =20 =3D=3D=3D Create a couple of snapshots using blockdev-snapshot =3D=3D=3D diff --git a/tests/qemu-iotests/144.out b/tests/qemu-iotests/144.out index c7aa2e4820..885a8874a5 100644 --- a/tests/qemu-iotests/144.out +++ b/tests/qemu-iotests/144.out @@ -9,7 +9,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D5368709= 12 { 'execute': 'qmp_capabilities' } {"return": {}} { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } } -Formatting 'TEST_DIR/tmp.qcow2', fmt=3Dqcow2 size=3D536870912 backing_file= =3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcounts= =3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/tmp.qcow2', fmt=3Dqcow2 size=3D536870912 backing_file= =3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcounts= =3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} =20 =3D=3D=3D Performing block-commit on active layer =3D=3D=3D @@ -31,6 +31,6 @@ Formatting 'TEST_DIR/tmp.qcow2', fmt=3Dqcow2 size=3D53687= 0912 backing_file=3DTEST_DIR/ =3D=3D=3D Performing Live Snapshot 2 =3D=3D=3D =20 { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0',= 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } } -Formatting 'TEST_DIR/tmp2.qcow2', fmt=3Dqcow2 size=3D536870912 backing_fil= e=3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/tmp2.qcow2', fmt=3Dqcow2 size=3D536870912 backing_fil= e=3DTEST_DIR/t.qcow2 backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} *** done diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out index a8eea166c3..ae43654d32 100644 --- a/tests/qemu-iotests/182.out +++ b/tests/qemu-iotests/182.out @@ -13,7 +13,7 @@ Is another process using the image [TEST_DIR/t.qcow2]? {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node0', 'driver':= 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } } {"return": {}} {'execute': 'blockdev-snapshot-sync', 'arguments': { 'node-name': 'node0',= 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'snapshot-node-name': 'node1= ' } } -Formatting 'TEST_DIR/t.qcow2.overlay', fmt=3Dqcow2 size=3D197120 backing_f= ile=3DTEST_DIR/t.qcow2 backing_fmt=3Dfile cluster_size=3D65536 lazy_refcoun= ts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2.overlay', fmt=3Dqcow2 size=3D197120 backing_f= ile=3DTEST_DIR/t.qcow2 backing_fmt=3Dfile cluster_size=3D65536 lazy_refcoun= ts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver':= 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } } {"return": {}} diff --git a/tests/qemu-iotests/185.out b/tests/qemu-iotests/185.out index 9a3b65782b..ac5ab16bc8 100644 --- a/tests/qemu-iotests/185.out +++ b/tests/qemu-iotests/185.out @@ -9,14 +9,14 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D= 67108864 =3D=3D=3D Creating backing chain =3D=3D=3D =20 { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 's= napshot-file': 'TEST_DIR/t.IMGFMT.mid', 'format': 'IMGFMT', 'mode': 'absolu= te-paths' } } -Formatting 'TEST_DIR/t.qcow2.mid', fmt=3Dqcow2 size=3D67108864 backing_fil= e=3DTEST_DIR/t.qcow2.base backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_ref= counts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2.mid', fmt=3Dqcow2 size=3D67108864 backing_fil= e=3DTEST_DIR/t.qcow2.base backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_ref= counts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu= -io disk "write 0 4M"' } } wrote 4194304/4194304 bytes at offset 0 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": ""} { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 's= napshot-file': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'absolute-p= aths' } } -Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 backing_file=3D= TEST_DIR/t.qcow2.mid backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D67108864 backing_file=3D= TEST_DIR/t.qcow2.mid backing_fmt=3Dqcow2 cluster_size=3D65536 lazy_refcount= s=3Doff refcount_bits=3D16 compression_type=3Dzlib {"return": {}} =20 =3D=3D=3D Start commit job and exit qemu =3D=3D=3D @@ -48,7 +48,7 @@ Formatting 'TEST_DIR/t.qcow2', fmt=3Dqcow2 size=3D6710886= 4 backing_file=3DTEST_DIR/t.q { 'execute': 'qmp_capabilities' } {"return": {}} { 'execute': 'drive-mirror', 'arguments': { 'device': 'disk', 'target': 'T= EST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 = } } -Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"return": {}} @@ -62,7 +62,7 @@ Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67= 108864 cluster_size=3D65536 l { 'execute': 'qmp_capabilities' } {"return": {}} { 'execute': 'drive-backup', 'arguments': { 'device': 'disk', 'target': 'T= EST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 = } } -Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/t.qcow2.copy', fmt=3Dqcow2 size=3D67108864 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "paused", "id": "disk"}} diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index 831ce3a289..6280ae6eed 100644 --- a/tests/qemu-iotests/198.out +++ b/tests/qemu-iotests/198.out @@ -36,6 +36,7 @@ image: json:{ /* filtered */ } file format: IMGFMT virtual size: 16 MiB (16777216 bytes) Format specific information: + compression type: zlib encrypt: ivgen alg: plain64 hash alg: sha256 @@ -79,6 +80,7 @@ file format: IMGFMT virtual size: 16 MiB (16777216 bytes) backing file: TEST_DIR/t.IMGFMT.base Format specific information: + compression type: zlib encrypt: ivgen alg: plain64 hash alg: sha256 diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out index 61e7241e0b..1a14255a83 100644 --- a/tests/qemu-iotests/206.out +++ b/tests/qemu-iotests/206.out @@ -18,6 +18,7 @@ virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -40,6 +41,7 @@ virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -62,6 +64,7 @@ virtual size: 32 MiB (33554432 bytes) cluster_size: 2097152 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: true refcount bits: 1 corrupt: false @@ -86,6 +89,7 @@ backing file: TEST_IMG.base backing file format: IMGFMT Format specific information: compat: 0.10 + compression type: zlib refcount bits: 16 =20 =3D=3D=3D Successful image creation (encrypted) =3D=3D=3D @@ -102,6 +106,7 @@ encrypted: yes cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 encrypt: diff --git a/tests/qemu-iotests/242.out b/tests/qemu-iotests/242.out index 7ac8404d11..091b9126ce 100644 --- a/tests/qemu-iotests/242.out +++ b/tests/qemu-iotests/242.out @@ -12,6 +12,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -32,6 +33,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false bitmaps: [0]: @@ -64,6 +66,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false bitmaps: [0]: @@ -104,6 +107,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false bitmaps: [0]: @@ -153,6 +157,7 @@ virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false bitmaps: [0]: diff --git a/tests/qemu-iotests/255.out b/tests/qemu-iotests/255.out index 348909fdef..a3c99fd62e 100644 --- a/tests/qemu-iotests/255.out +++ b/tests/qemu-iotests/255.out @@ -3,9 +3,9 @@ Finishing a commit job with background reads =20 =3D=3D=3D Create backing chain and start VM =3D=3D=3D =20 -Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=3Dqcow2 size=3D134217728 cluste= r_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=3Dqcow2 size=3D134217728 cluste= r_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dz= lib =20 -Formatting 'TEST_DIR/PID-t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-t.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_si= ze=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 =3D=3D=3D Start background read requests =3D=3D=3D =20 @@ -23,9 +23,9 @@ Closing the VM while a job is being cancelled =20 =3D=3D=3D Create images and start VM =3D=3D=3D =20 -Formatting 'TEST_DIR/PID-src.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_= size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-src.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_= size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-dst.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_= size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-dst.qcow2', fmt=3Dqcow2 size=3D134217728 cluster_= size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 wrote 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/274.out b/tests/qemu-iotests/274.out index 9d6fdeb1f7..d24ff681af 100644 --- a/tests/qemu-iotests/274.out +++ b/tests/qemu-iotests/274.out @@ -1,9 +1,9 @@ =3D=3D Commit tests =3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 +Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -52,6 +52,7 @@ cluster_size: 65536 backing file: TEST_DIR/PID-base Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -63,11 +64,11 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing HMP commit (top -> mid) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 +Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -81,6 +82,7 @@ cluster_size: 65536 backing file: TEST_DIR/PID-base Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -92,11 +94,11 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing QMP active commit (top -> mid) =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D2097152 cluster_size=3D= 65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 +Formatting 'TEST_DIR/PID-mid', fmt=3Dqcow2 size=3D1048576 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D2097152 backing_file=3DT= EST_DIR/PID-mid cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 2097152/2097152 bytes at offset 0 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -116,6 +118,7 @@ cluster_size: 65536 backing file: TEST_DIR/PID-base Format specific information: compat: 1.1 + compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false @@ -128,9 +131,9 @@ read 1048576/1048576 bytes at offset 1048576 =20 =3D=3D Resize tests =3D=3D =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D6442450944 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D6442450944 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D1073741824 backing_file= =3DTEST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bit= s=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D1073741824 backing_file= =3DTEST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bit= s=3D16 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 5368709120 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -147,9 +150,9 @@ read 65536/65536 bytes at offset 5368709120 { "start": 1073741824, "length": 7516192768, "depth": 0, "zero": true, "da= ta": false}] =20 =3D=3D=3D preallocation=3Dmetadata =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D34359738368 cluster_siz= e=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D34359738368 cluster_siz= e=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D32212254720 backing_file= =3DTEST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bit= s=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D32212254720 backing_file= =3DTEST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bit= s=3D16 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 33285996544 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -171,9 +174,9 @@ read 65536/65536 bytes at offset 33285996544 { "start": 34896609280, "length": 536870912, "depth": 0, "zero": true, "da= ta": false, "offset": 2685075456}] =20 =3D=3D=3D preallocation=3Dfalloc =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D10485760 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D10485760 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D5242880 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D5242880 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 9437184 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -190,9 +193,9 @@ read 65536/65536 bytes at offset 9437184 { "start": 5242880, "length": 10485760, "depth": 0, "zero": false, "data":= true, "offset": 327680}] =20 =3D=3D=3D preallocation=3Dfull =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D16777216 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D16777216 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D8388608 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D8388608 backing_file=3DT= EST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D= 16 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 11534336 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -209,9 +212,9 @@ read 65536/65536 bytes at offset 11534336 { "start": 8388608, "length": 4194304, "depth": 0, "zero": false, "data": = true, "offset": 327680}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D393216 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D393216 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D259072 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D259072 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 259072 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -229,9 +232,9 @@ read 65536/65536 bytes at offset 259072 { "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": fal= se}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D409600 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D409600 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D262144 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D262144 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 344064 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -248,9 +251,9 @@ read 65536/65536 bytes at offset 344064 { "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": fal= se}] =20 =3D=3D=3D preallocation=3Doff =3D=3D=3D -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D524288 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D524288 cluster_size=3D6= 5536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 -Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D262144 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-top', fmt=3Dqcow2 size=3D262144 backing_file=3DTE= ST_DIR/PID-base cluster_size=3D65536 lazy_refcounts=3Doff refcount_bits=3D1= 6 compression_type=3Dzlib =20 wrote 65536/65536 bytes at offset 446464 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out index 5d382faaa8..92e4d14079 100644 --- a/tests/qemu-iotests/280.out +++ b/tests/qemu-iotests/280.out @@ -1,4 +1,4 @@ -Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D67108864 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 +Formatting 'TEST_DIR/PID-base', fmt=3Dqcow2 size=3D67108864 cluster_size= =3D65536 lazy_refcounts=3Doff refcount_bits=3D16 compression_type=3Dzlib =20 =3D=3D=3D Launch VM =3D=3D=3D Enabling migration QMP events on VM... diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 3f8ee3e5f7..279e0bbb0d 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -152,7 +152,8 @@ _filter_img_create() -e "s# refcount_bits=3D[0-9]\\+##g" \ -e "s# key-secret=3D[a-zA-Z0-9]\\+##g" \ -e "s# iter-time=3D[0-9]\\+##g" \ - -e "s# force_size=3D\\(on\\|off\\)##g" + -e "s# force_size=3D\\(on\\|off\\)##g" \ + -e "s# compression_type=3D[a-zA-Z0-9]\\+##g" } =20 _filter_img_info() --=20 2.17.0 From nobody Sat May 18 21:00:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1588840045; cv=none; d=zohomail.com; s=zohoarc; b=JP5MXHX2T/mbUX5GnXC0eGcPR5jSmkWousZUJu80Oxe+0+5fugzUosSYryT+ODkkC9f6Xhva6kPbKkQ86kw7pg/BEu0bTcBj+DH4sh6SzkUEAZ2yEbskKbTEilLpVLrLUlQGDXgs/nLbROgAZnQCxDChkd0vRPVmmEOuYOhLwRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588840045; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=sfDUyoWpZGDGeb9iIC/G2kkAT7FKJvs1RC8kEG836SY=; b=XrXXHVb+VbrppZW9QXmWyCsgSmgFmdgmBYNyAHtC/UdMwW7cmGw/EXslI7Edmax/isaKLbMvDVSAzI1Lhm2TppF0FtucOG02s6EIV8yPtUHxskbmT9g/MZWExDOuIiKkBOY6GYLm+x1h5vOSQN8ECAX8Y+/WlfTI1l05wMZYUpk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588840045303609.2510458606433; Thu, 7 May 2020 01:27:25 -0700 (PDT) Received: from localhost ([::1]:59390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbsK-0000FI-2g for importer@patchew.org; Thu, 07 May 2020 04:27:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbqm-0005x3-TK; Thu, 07 May 2020 04:25:48 -0400 Received: from relay.sw.ru ([185.231.240.75]:37764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbql-0004mf-Ok; Thu, 07 May 2020 04:25:48 -0400 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jWbqa-00024P-SO; Thu, 07 May 2020 11:25:37 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v24 2/4] qcow2: rework the cluster compression routine Date: Thu, 7 May 2020 11:25:19 +0300 Message-Id: <20200507082521.29210-3-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200507082521.29210-1-dplotnikov@virtuozzo.com> References: <20200507082521.29210-1-dplotnikov@virtuozzo.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.231.240.75; envelope-from=dplotnikov@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 04:25:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The patch enables processing the image compression type defined for the image and chooses an appropriate method for image clusters (de)compression. Signed-off-by: Denis Plotnikov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-threads.c | 71 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c index a68126f291..7dbaf53489 100644 --- a/block/qcow2-threads.c +++ b/block/qcow2-threads.c @@ -74,7 +74,9 @@ typedef struct Qcow2CompressData { } Qcow2CompressData; =20 /* - * qcow2_compress() + * qcow2_zlib_compress() + * + * Compress @src_size bytes of data using zlib compression method * * @dest - destination buffer, @dest_size bytes * @src - source buffer, @src_size bytes @@ -83,8 +85,8 @@ typedef struct Qcow2CompressData { * -ENOMEM destination buffer is not enough to store compressed d= ata * -EIO on any other error */ -static ssize_t qcow2_compress(void *dest, size_t dest_size, - const void *src, size_t src_size) +static ssize_t qcow2_zlib_compress(void *dest, size_t dest_size, + const void *src, size_t src_size) { ssize_t ret; z_stream strm; @@ -119,10 +121,10 @@ static ssize_t qcow2_compress(void *dest, size_t dest= _size, } =20 /* - * qcow2_decompress() + * qcow2_zlib_decompress() * * Decompress some data (not more than @src_size bytes) to produce exactly - * @dest_size bytes. + * @dest_size bytes using zlib compression method * * @dest - destination buffer, @dest_size bytes * @src - source buffer, @src_size bytes @@ -130,8 +132,8 @@ static ssize_t qcow2_compress(void *dest, size_t dest_s= ize, * Returns: 0 on success * -EIO on fail */ -static ssize_t qcow2_decompress(void *dest, size_t dest_size, - const void *src, size_t src_size) +static ssize_t qcow2_zlib_decompress(void *dest, size_t dest_size, + const void *src, size_t src_size) { int ret; z_stream strm; @@ -191,20 +193,67 @@ qcow2_co_do_compress(BlockDriverState *bs, void *dest= , size_t dest_size, return arg.ret; } =20 +/* + * qcow2_co_compress() + * + * Compress @src_size bytes of data using the compression + * method defined by the image compression type + * + * @dest - destination buffer, @dest_size bytes + * @src - source buffer, @src_size bytes + * + * Returns: compressed size on success + * a negative error code on failure + */ ssize_t coroutine_fn qcow2_co_compress(BlockDriverState *bs, void *dest, size_t dest_size, const void *src, size_t src_size) { - return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, - qcow2_compress); + BDRVQcow2State *s =3D bs->opaque; + Qcow2CompressFunc fn; + + switch (s->compression_type) { + case QCOW2_COMPRESSION_TYPE_ZLIB: + fn =3D qcow2_zlib_compress; + break; + + default: + abort(); + } + + return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, fn); } =20 +/* + * qcow2_co_decompress() + * + * Decompress some data (not more than @src_size bytes) to produce exactly + * @dest_size bytes using the compression method defined by the image + * compression type + * + * @dest - destination buffer, @dest_size bytes + * @src - source buffer, @src_size bytes + * + * Returns: 0 on success + * a negative error code on failure + */ ssize_t coroutine_fn qcow2_co_decompress(BlockDriverState *bs, void *dest, size_t dest_size, const void *src, size_t src_size) { - return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, - qcow2_decompress); + BDRVQcow2State *s =3D bs->opaque; + Qcow2CompressFunc fn; + + switch (s->compression_type) { + case QCOW2_COMPRESSION_TYPE_ZLIB: + fn =3D qcow2_zlib_decompress; + break; + + default: + abort(); + } + + return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, fn); } =20 =20 --=20 2.17.0 From nobody Sat May 18 21:00:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1588840114; cv=none; d=zohomail.com; s=zohoarc; b=X9b3v1QFbwmiC0yDct5jJLWDwQscaRqdPNQ8G55jVMsds8vV4rwv8Z75Gf1kcfGS5b/I/e6KBaSXU69jDzcBeyTA0uFv7vDOUPIfmO5TOBQEFFK1Z8UMNwxNH/6pUOzfcCaSFtyv9UVVQfV3CWBJCZy+DFmrKbAlMwtcLL+fvoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588840114; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=8kVyPZv/A5hUDntW/Nb6SVJgL8QtZOki8XXsg5oAJK0=; b=e7zuHiPgJkGZtmU07UPHMsbdGreGEi9d/c1J5A3zT+L1wt4orE2AohQWlmYrBEuUppAcS0e0jSDM/+aFX+DaajXei2OYzx3SjOVwSD0QyjhkYs7squLKKPyRAefrnl3lyoVuP492BbQnTl2kKPuOy1Y1dBu/Lx0Mr4/wmr2h4vg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588840114991984.1108914962873; Thu, 7 May 2020 01:28:34 -0700 (PDT) Received: from localhost ([::1]:34260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbtR-0001YL-OA for importer@patchew.org; Thu, 07 May 2020 04:28:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbqo-0005z2-Lj; Thu, 07 May 2020 04:25:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:37758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbql-0004mc-Ql; Thu, 07 May 2020 04:25:50 -0400 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jWbqb-00024P-2r; Thu, 07 May 2020 11:25:37 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v24 3/4] qcow2: add zstd cluster compression Date: Thu, 7 May 2020 11:25:20 +0300 Message-Id: <20200507082521.29210-4-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200507082521.29210-1-dplotnikov@virtuozzo.com> References: <20200507082521.29210-1-dplotnikov@virtuozzo.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.231.240.75; envelope-from=dplotnikov@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 04:25:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" zstd significantly reduces cluster compression time. It provides better compression performance maintaining the same level of the compression ratio in comparison with zlib, which, at the moment, is the only compression method available. The performance test results: 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=3D[zlib|zstd] src.img [zlib|zstd]_compressed.img decompress cmd time ./qemu-img convert -O qcow2 [zlib|zstd]_compressed.img uncompressed.img compression decompression zlib zstd zlib zstd Acked-by: Markus Armbruster ------------------------------------------------------------ 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.57 compressed image size in both cases: 1.4G Signed-off-by: Denis Plotnikov QAPI part: Acked-by: Markus Armbruster --- docs/interop/qcow2.txt | 1 + configure | 2 +- qapi/block-core.json | 3 +- block/qcow2-threads.c | 169 +++++++++++++++++++++++++++++++++++++++++ block/qcow2.c | 7 ++ 5 files changed, 180 insertions(+), 2 deletions(-) diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt index 298a031310..cb723463f2 100644 --- a/docs/interop/qcow2.txt +++ b/docs/interop/qcow2.txt @@ -212,6 +212,7 @@ version 2. =20 Available compression type values: 0: zlib + 1: zstd =20 =20 =3D=3D=3D Header padding =3D=3D=3D diff --git a/configure b/configure index 23b5e93752..4e3a1690ea 100755 --- a/configure +++ b/configure @@ -1861,7 +1861,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: lzfse support of lzfse compression library (for reading lzfse-compressed dmg images) zstd support for zstd compression library - (for migration compression) + (for migration compression and qcow2 cluster compression) seccomp seccomp support coroutine-pool coroutine freelist (better performance) glusterfs GlusterFS backend diff --git a/qapi/block-core.json b/qapi/block-core.json index 1522e2983f..6fbacddab2 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4293,11 +4293,12 @@ # Compression type used in qcow2 image file # # @zlib: zlib compression, see +# @zstd: zstd compression, see # # Since: 5.1 ## { 'enum': 'Qcow2CompressionType', - 'data': [ 'zlib' ] } + 'data': [ 'zlib', { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] } =20 ## # @BlockdevCreateOptionsQcow2: diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c index 7dbaf53489..1914baf456 100644 --- a/block/qcow2-threads.c +++ b/block/qcow2-threads.c @@ -28,6 +28,11 @@ #define ZLIB_CONST #include =20 +#ifdef CONFIG_ZSTD +#include +#include +#endif + #include "qcow2.h" #include "block/thread-pool.h" #include "crypto.h" @@ -166,6 +171,160 @@ static ssize_t qcow2_zlib_decompress(void *dest, size= _t dest_size, return ret; } =20 +#ifdef CONFIG_ZSTD + +/* + * qcow2_zstd_compress() + * + * Compress @src_size bytes of data using zstd compression method + * + * @dest - destination buffer, @dest_size bytes + * @src - source buffer, @src_size bytes + * + * Returns: compressed size on success + * -ENOMEM destination buffer is not enough to store compressed d= ata + * -EIO on any other error + */ +static ssize_t qcow2_zstd_compress(void *dest, size_t dest_size, + const void *src, size_t src_size) +{ + ssize_t ret; + size_t zstd_ret; + ZSTD_outBuffer output =3D { + .dst =3D dest, + .size =3D dest_size, + .pos =3D 0 + }; + ZSTD_inBuffer input =3D { + .src =3D src, + .size =3D src_size, + .pos =3D 0 + }; + ZSTD_CCtx *cctx =3D ZSTD_createCCtx(); + + if (!cctx) { + return -EIO; + } + /* + * Use the zstd streamed interface for symmetry with decompression, + * where streaming is essential since we don't record the exact + * compressed size. + * + * ZSTD_compressStream2() tries to compress everything it could + * with a single call. Although, ZSTD docs says that: + * "You must continue calling ZSTD_compressStream2() with ZSTD_e_end + * until it returns 0, at which point you are free to start a new fram= e", + * in out tests we saw the only case when it returned with >0 - + * when the output buffer was too small. In that case, + * ZSTD_compressStream2() expects a bigger buffer on the next call. + * We can't provide a bigger buffer because we are limited with dest_s= ize + * which we pass to the ZSTD_compressStream2() at once. + * So, we don't need any loops and just abort the compression when we + * don't get 0 result on the first call. + */ + zstd_ret =3D ZSTD_compressStream2(cctx, &output, &input, ZSTD_e_end); + + if (zstd_ret) { + if (zstd_ret > output.size - output.pos) { + ret =3D -ENOMEM; + } else { + ret =3D -EIO; + } + goto out; + } + + /* make sure that zstd didn't overflow the dest buffer */ + assert(output.pos <=3D dest_size); + ret =3D output.pos; +out: + ZSTD_freeCCtx(cctx); + return ret; +} + +/* + * qcow2_zstd_decompress() + * + * Decompress some data (not more than @src_size bytes) to produce exactly + * @dest_size bytes using zstd compression method + * + * @dest - destination buffer, @dest_size bytes + * @src - source buffer, @src_size bytes + * + * Returns: 0 on success + * -EIO on any error + */ +static ssize_t qcow2_zstd_decompress(void *dest, size_t dest_size, + const void *src, size_t src_size) +{ + size_t zstd_ret =3D 0; + ssize_t ret =3D 0; + ZSTD_outBuffer output =3D { + .dst =3D dest, + .size =3D dest_size, + .pos =3D 0 + }; + ZSTD_inBuffer input =3D { + .src =3D src, + .size =3D src_size, + .pos =3D 0 + }; + ZSTD_DCtx *dctx =3D ZSTD_createDCtx(); + + if (!dctx) { + return -EIO; + } + + /* + * The compressed stream from the input buffer may consist of more + * than one zstd frame. So we iterate until we get a fully + * uncompressed cluster. + * From zstd docs related to ZSTD_decompressStream: + * "return : 0 when a frame is completely decoded and fully flushed" + * We suppose that this means: each time ZSTD_decompressStream reads + * only ONE full frame and returns 0 if and only if that frame + * is completely decoded and flushed. Only after returning 0, + * ZSTD_decompressStream reads another ONE full frame. + */ + while (output.pos < output.size) { + size_t last_in_pos =3D input.pos; + size_t last_out_pos =3D output.pos; + zstd_ret =3D ZSTD_decompressStream(dctx, &output, &input); + + if (ZSTD_isError(zstd_ret)) { + ret =3D -EIO; + break; + } + + /* + * The ZSTD manual is vague about what to do if it reads + * the buffer partially, and we don't want to get stuck + * in an infinite loop where ZSTD_decompressStream + * returns > 0 waiting for another input chunk. So, we add + * a check which ensures that the loop makes some progress + * on each step. + */ + if (last_in_pos >=3D input.pos && + last_out_pos >=3D output.pos) { + ret =3D -EIO; + break; + } + } + /* + * Make sure that we have the frame fully flushed here + * if not, we somehow managed to get uncompressed cluster + * greater then the cluster size, possibly because of its + * damage. + */ + if (zstd_ret > 0) { + ret =3D -EIO; + } + + ZSTD_freeDCtx(dctx); + assert(ret =3D=3D 0 || ret =3D=3D -EIO); + return ret; +} +#endif + static int qcow2_compress_pool_func(void *opaque) { Qcow2CompressData *data =3D opaque; @@ -217,6 +376,11 @@ qcow2_co_compress(BlockDriverState *bs, void *dest, si= ze_t dest_size, fn =3D qcow2_zlib_compress; break; =20 +#ifdef CONFIG_ZSTD + case QCOW2_COMPRESSION_TYPE_ZSTD: + fn =3D qcow2_zstd_compress; + break; +#endif default: abort(); } @@ -249,6 +413,11 @@ qcow2_co_decompress(BlockDriverState *bs, void *dest, = size_t dest_size, fn =3D qcow2_zlib_decompress; break; =20 +#ifdef CONFIG_ZSTD + case QCOW2_COMPRESSION_TYPE_ZSTD: + fn =3D qcow2_zstd_decompress; + break; +#endif default: abort(); } diff --git a/block/qcow2.c b/block/qcow2.c index a5587de1d2..90559e28f8 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1246,6 +1246,9 @@ static int validate_compression_type(BDRVQcow2State *= s, Error **errp) { switch (s->compression_type) { case QCOW2_COMPRESSION_TYPE_ZLIB: +#ifdef CONFIG_ZSTD + case QCOW2_COMPRESSION_TYPE_ZSTD: +#endif break; =20 default: @@ -3479,6 +3482,10 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) } =20 switch (qcow2_opts->compression_type) { +#ifdef CONFIG_ZSTD + case QCOW2_COMPRESSION_TYPE_ZSTD: + break; +#endif default: error_setg(errp, "Unknown compression type"); goto out; --=20 2.17.0 From nobody Sat May 18 21:00:26 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1588840003; cv=none; d=zohomail.com; s=zohoarc; b=DNZVGk9h0xuhPl4VVUpbLvFtOOpF1xdTBjjjoXk0yyOeWtl481XB+gFj5PajjkTNdRkw3aRIAtxwcsl90JCLhNhQOPXGyx21g7ixN05+3lea/3wFcxaQIJwST/A1oLDOHQeoY5wta0jEOoqcJWwcynYpLzfK6ENogP9cZroX4js= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588840003; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=cxk4yFL9UfPkygdH3Gu2ARwweDehaDLprL0/TYJra2U=; b=grRombw29NYHFz+/qf53NwJTUhXwAExJKKbQSh7KJcTvDFp71icsrteKvcYSNRlwtsVDUIinLQ0M42iRHjBlNxyWGoHHyNDNhqzLh6Ox/Z279CB4z35hwLCCwWoHuxjrggHWIR/oJmVKLbKR2iYsflI7cjgDMIi/E3GYoW9Fuhw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588840003290617.5333798620276; Thu, 7 May 2020 01:26:43 -0700 (PDT) Received: from localhost ([::1]:55682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWbrd-0007DE-SC for importer@patchew.org; Thu, 07 May 2020 04:26:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbqn-0005xz-Si; Thu, 07 May 2020 04:25:49 -0400 Received: from relay.sw.ru ([185.231.240.75]:37752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWbql-0004mb-Ps; Thu, 07 May 2020 04:25:49 -0400 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jWbqb-00024P-9J; Thu, 07 May 2020 11:25:37 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v24 4/4] iotests: 287: add qcow2 compression type test Date: Thu, 7 May 2020 11:25:21 +0300 Message-Id: <20200507082521.29210-5-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200507082521.29210-1-dplotnikov@virtuozzo.com> References: <20200507082521.29210-1-dplotnikov@virtuozzo.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.231.240.75; envelope-from=dplotnikov@virtuozzo.com; helo=relay.sw.ru X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/07 04:25:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The test checks fulfilling qcow2 requirements for the compression type feature and zstd compression type operability. Signed-off-by: Denis Plotnikov Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- tests/qemu-iotests/287 | 152 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/287.out | 67 ++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 220 insertions(+) create mode 100755 tests/qemu-iotests/287 create mode 100644 tests/qemu-iotests/287.out diff --git a/tests/qemu-iotests/287 b/tests/qemu-iotests/287 new file mode 100755 index 0000000000..f98a4cadc1 --- /dev/null +++ b/tests/qemu-iotests/287 @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +# +# Test case for an image using zstd compression +# +# Copyright (c) 2020 Virtuozzo International GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Ddplotnikov@virtuozzo.com + +seq=3D"$(basename $0)" +echo "QA output created by $seq" + +status=3D1 # failure is the default! + +# standard environment +. ./common.rc +. ./common.filter + +# This tests qocw2-specific low-level functionality +_supported_fmt qcow2 +_supported_proto file +_supported_os Linux +_unsupported_imgopts 'compat=3D0.10' data_file + +COMPR_IMG=3D"$TEST_IMG.compressed" +RAND_FILE=3D"$TEST_DIR/rand_data" + +_cleanup() +{ + _cleanup_test_img + _rm_test_img "$COMPR_IMG" + rm -f "$RAND_FILE" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# for all the cases +CLUSTER_SIZE=3D65536 + +# Check if we can run this test. +if IMGOPTS=3D'compression_type=3Dzstd' _make_test_img 64M | + grep "Invalid parameter 'zstd'"; then + _notrun "ZSTD is disabled" +fi + +echo +echo "=3D=3D=3D Testing compression type incompatible bit setting for zlib= =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzlib 64M +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +echo +echo "=3D=3D=3D Testing compression type incompatible bit setting for zstd= =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzstd 64M +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +echo +echo "=3D=3D=3D Testing zlib with incompatible bit set =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzlib 64M +$PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible 3 +# to make sure the bit was actually set +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then + echo "Error: The image opened successfully. The image must not be open= ed." +fi + +echo +echo "=3D=3D=3D Testing zstd with incompatible bit unset =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzstd 64M +$PYTHON qcow2.py "$TEST_IMG" set-header incompatible_features 0 +# to make sure the bit was actually unset +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then + echo "Error: The image opened successfully. The image must not be open= ed." +fi + +echo +echo "=3D=3D=3D Testing compression type values =3D=3D=3D" +echo +# zlib=3D0 +_make_test_img -o compression_type=3Dzlib 64M +peek_file_be "$TEST_IMG" 104 1 +echo + +# zstd=3D1 +_make_test_img -o compression_type=3Dzstd 64M +peek_file_be "$TEST_IMG" 104 1 +echo + +echo +echo "=3D=3D=3D Testing simple reading and writing with zstd =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzstd 64M +$QEMU_IO -c "write -c -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io +# read on the cluster boundaries +$QEMU_IO -c "read -v 131070 8 " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -v 65534 8" "$TEST_IMG" | _filter_qemu_io + +echo +echo "=3D=3D=3D Testing adjacent clusters reading and writing with zstd = =3D=3D=3D" +echo +_make_test_img -o compression_type=3Dzstd 64M +$QEMU_IO -c "write -c -P 0xAB 0 64K " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write -c -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "write -c -P 0xAD 128K 64K " "$TEST_IMG" | _filter_qemu_io + +$QEMU_IO -c "read -P 0xAB 0 64k " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -P 0xAC 64K 64k " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -P 0xAD 128K 64k " "$TEST_IMG" | _filter_qemu_io + +echo +echo "=3D=3D=3D Testing incompressible cluster processing with zstd =3D=3D= =3D" +echo +# create a 2M image and fill it with 1M likely incompressible data +# and 1M compressible data +dd if=3D/dev/urandom of=3D"$RAND_FILE" bs=3D1M count=3D1 seek=3D1 +QEMU_IO_OPTIONS=3D"$QEMU_IO_OPTIONS_NO_FMT" \ +$QEMU_IO -f raw -c "write -P 0xFA 0 1M" "$RAND_FILE" | _filter_qemu_io + +$QEMU_IMG convert -f raw -O $IMGFMT -c \ +-o "$(_optstr_add "$IMGOPTS" "compression_type=3Dzlib")" "$RAND_FILE" \ +"$TEST_IMG" | _filter_qemu_io + +$QEMU_IMG convert -O $IMGFMT -c \ +-o "$(_optstr_add "$IMGOPTS" "compression_type=3Dzstd")" "$TEST_IMG" \ +"$COMPR_IMG" | _filter_qemu_io + +$QEMU_IMG compare "$TEST_IMG" "$COMPR_IMG" + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/287.out b/tests/qemu-iotests/287.out new file mode 100644 index 0000000000..6b9dfb4af0 --- /dev/null +++ b/tests/qemu-iotests/287.out @@ -0,0 +1,67 @@ +QA output created by 287 + +=3D=3D=3D Testing compression type incompatible bit setting for zlib =3D= =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +incompatible_features [] + +=3D=3D=3D Testing compression type incompatible bit setting for zstd =3D= =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +incompatible_features [3] + +=3D=3D=3D Testing zlib with incompatible bit set =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +incompatible_features [3] + +=3D=3D=3D Testing zstd with incompatible bit unset =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +incompatible_features [] + +=3D=3D=3D Testing compression type values =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 + 0 +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 + 1 + +=3D=3D=3D Testing simple reading and writing with zstd =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +0001fffe: ac ac 00 00 00 00 00 00 ........ +read 8/8 bytes at offset 131070 +8 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +0000fffe: 00 00 ac ac ac ac ac ac ........ +read 8/8 bytes at offset 65534 +8 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Testing adjacent clusters reading and writing with zstd =3D=3D= =3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +wrote 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 131072 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 131072 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Testing incompressible cluster processing with zstd =3D=3D=3D + +1+0 records in +1+0 records out +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Images are identical. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 1710470e70..f1fd4e357f 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -295,6 +295,7 @@ 283 auto quick 284 rw 286 rw quick +287 auto quick 288 quick 289 rw quick 290 rw auto quick --=20 2.17.0