From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788765; cv=none; d=zohomail.com; s=zohoarc; b=m3LblYWPHP1LD/P6VQIj8cDe6waXzNtHvOJtfWrn8yJXj/0K3YhKQ/LWzKRYqWNI7FhBZaSWjzEABnGEQpmB48WQAX1yQVM4LUgzTYc7Y0JAzj+c/q1G9AV11TX483wxNQVEE4qE0ecbpah/EhLPPqV4l4gNWiad8g+vm+EEuN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788765; 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=LTJFnhCMuSe8l2WYuEvp2OFN3+Gc3y9ULpVhQ9/UlME=; b=WUUqUuUFivOGWSzgvShV+r6NmuOUSBH7/KE1Tg6DdW++O8akGEQ/RCHO0fx+LXdERX2sYI5baUKfdPySFySTdwPWCZg0c83JrCqaWV+UACXzWzkc6JaJ7IQKoHxbJjJqo0Xn5CfwDZ+Pbs8iSCzHq33iGlqRJWleZngkfJQs/iY= 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 1582788765800906.4856937504945; Wed, 26 Feb 2020 23:32:45 -0800 (PST) Received: from localhost ([::1]:54796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Df2-0002TS-OG for importer@patchew.org; Thu, 27 Feb 2020 02:32:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7DcY-0000G1-Kd for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcW-0000Ah-IE for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:10 -0500 Received: from relay.sw.ru ([185.231.240.75]:33982) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005f-Le; Thu, 27 Feb 2020 02:30:07 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcO-0003Tx-AU; Thu, 27 Feb 2020 10:30:00 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 1/8] qcow2: introduce compression type feature Date: Thu, 27 Feb 2020 10:29:46 +0300 Message-Id: <20200227072953.25445-2-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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 that indicates which allow to 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. Signed-off-by: Denis Plotnikov --- block/qcow2.c | 105 ++++++++++++++++++++++++++++++++++++++ block/qcow2.h | 31 ++++++++--- include/block/block_int.h | 1 + qapi/block-core.json | 22 +++++++- 4 files changed, 150 insertions(+), 9 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 3c754f616b..2ccb2cabd1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1242,6 +1242,50 @@ static int qcow2_update_options(BlockDriverState *bs= , QDict *options, return ret; } =20 +static int validate_compression_type(BDRVQcow2State *s, Error **errp) +{ + /* + * Sanity check + * according to qcow2 spec, the compression type is 1-byte field + * but in BDRVQcow2State the compression_type is enum sizeof(int) + * so, the max compression_type value is 255. + */ + if (s->compression_type > 0xff) { + error_setg(errp, "qcow2: compression type value is too big"); + return -EINVAL; + } + + 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_TYPE) { + error_setg(errp, "qcow2: Compression type incompatible feature= " + "bit must not be set"); + return -EINVAL; + } + } else { + if (!(s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION_TYPE))= { + 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 +1401,26 @@ 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)) { + /* + * don't deal with endians since compression_type is 1 byte long + */ + 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, @@ -2720,6 +2784,12 @@ 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), @@ -2742,6 +2812,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 (uint8_t) s->compression_type, }; =20 /* For older versions, write a shorter header */ @@ -2839,6 +2910,11 @@ int qcow2_update_header(BlockDriverState *bs) .bit =3D QCOW2_COMPAT_LAZY_REFCOUNTS_BITNR, .name =3D "lazy refcounts", }, + { + .type =3D QCOW2_FEAT_TYPE_INCOMPATIBLE, + .bit =3D QCOW2_INCOMPAT_COMPRESSION_TYPE_BITNR, + .name =3D "compression type", + }, }; =20 ret =3D header_ext_add(buf, QCOW2_EXT_MAGIC_FEATURE_TABLE, @@ -3401,6 +3477,7 @@ 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), + .compression_type =3D (uint8_t) QCOW2_COMPRESSION_TYPE_Z= LIB, .header_length =3D cpu_to_be32(sizeof(*header)), }; =20 @@ -3420,6 +3497,26 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) cpu_to_be64(QCOW2_AUTOCLEAR_DATA_FILE_RAW); } =20 + if (qcow2_opts->has_compression_type && + qcow2_opts->compression_type !=3D QCOW2_COMPRESSION_TYPE_ZLIB) { + + if (qcow2_opts->compression_type > 0xff) { + error_setg_errno(errp, -EINVAL, "Too big compression type valu= e"); + goto out; + } + + switch (qcow2_opts->compression_type) { + default: + error_setg_errno(errp, -EINVAL, "Unknown compression type"); + goto out; + } + + header->compression_type =3D (uint8_t) qcow2_opts->compression_typ= e; + + header->incompatible_features |=3D + cpu_to_be64(QCOW2_INCOMPAT_COMPRESSION_TYPE); + } + ret =3D blk_pwrite(blk, 0, header, cluster_size, 0); g_free(header); if (ret < 0) { @@ -3602,6 +3699,7 @@ static int coroutine_fn qcow2_co_create_opts(const ch= ar *filename, QemuOpts *opt { 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 @@ -4859,6 +4957,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 @@ -5516,6 +5615,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 clusters compress= ion", + .def_value_str =3D "zlib" + }, { /* end of list */ } } }; diff --git a/block/qcow2.h b/block/qcow2.h index 0942126232..f92412ed5e 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -146,6 +146,12 @@ 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 typedef struct QEMU_PACKED QCowSnapshotHeader { @@ -213,16 +219,20 @@ enum { =20 /* Incompatible feature bits */ enum { - QCOW2_INCOMPAT_DIRTY_BITNR =3D 0, - QCOW2_INCOMPAT_CORRUPT_BITNR =3D 1, - QCOW2_INCOMPAT_DATA_FILE_BITNR =3D 2, - 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_DIRTY_BITNR =3D 0, + QCOW2_INCOMPAT_CORRUPT_BITNR =3D 1, + QCOW2_INCOMPAT_DATA_FILE_BITNR =3D 2, + QCOW2_INCOMPAT_COMPRESSION_TYPE_BITNR =3D 3, + QCOW2_INCOMPAT_DIRTY =3D 1 << QCOW2_INCOMPAT_DIRTY_BI= TNR, + QCOW2_INCOMPAT_CORRUPT =3D 1 << QCOW2_INCOMPAT_CORRUPT_= BITNR, + QCOW2_INCOMPAT_DATA_FILE =3D 1 << QCOW2_INCOMPAT_DATA_FIL= E_BITNR, + QCOW2_INCOMPAT_COMPRESSION_TYPE =3D + 1 << QCOW2_INCOMPAT_COMPRESSION_TYPE_BITNR, =20 QCOW2_INCOMPAT_MASK =3D QCOW2_INCOMPAT_DIRTY | QCOW2_INCOMPAT_CORRUPT - | QCOW2_INCOMPAT_DATA_FILE, + | QCOW2_INCOMPAT_DATA_FILE + | QCOW2_INCOMPAT_COMPRESSION_TYPE, }; =20 /* Compatible feature bits */ @@ -369,6 +379,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. + * 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 6f9fd5e20e..2c6bb9dc99 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/qapi/block-core.json b/qapi/block-core.json index 85e27bb61f..873fbef3b5 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.0) +# # Since: 1.7 ## { 'struct': 'ImageInfoSpecificQCow2', @@ -89,7 +91,8 @@ '*corrupt': 'bool', 'refcount-bits': 'int', '*encrypt': 'ImageInfoSpecificQCow2Encryption', - '*bitmaps': ['Qcow2BitmapInfo'] + '*bitmaps': ['Qcow2BitmapInfo'], + 'compression-type': 'Qcow2CompressionType' } } =20 ## @@ -4392,6 +4395,18 @@ 'data': [ 'v2', 'v3' ] } =20 =20 +## +# @Qcow2CompressionType: +# +# Compression type used in qcow2 image file +# +# @zlib: zlib compression, see +# +# Since: 5.0 +## +{ 'enum': 'Qcow2CompressionType', + 'data': [ 'zlib' ] } + ## # @BlockdevCreateOptionsQcow2: # @@ -4415,6 +4430,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.0) # # Since: 2.12 ## @@ -4430,7 +4447,8 @@ '*cluster-size': 'size', '*preallocation': 'PreallocMode', '*lazy-refcounts': 'bool', - '*refcount-bits': 'int' } } + '*refcount-bits': 'int', + '*compression-type': 'Qcow2CompressionType' } } =20 ## # @BlockdevCreateOptionsQed: --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788940; cv=none; d=zohomail.com; s=zohoarc; b=Oij15ECUW8mQa2RW7wTSXaRSO8AnHuqoE4PAAfcVoksHOpugrgxwQA48m8Fskzhiy1cGjvGh4tItY0BFK/uuNAsThkqKQUJGk3xzRBmVGJgRb0lmVXwTtt9KJUjWj/gITlqaK7D7W1t9HmVa7FC17wiA06JkLh+S+xUnPNo0J5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788940; 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=gZN+j69OfIqfv9qYalCmCdcXlWCsQz6gd7H3qSr3Bns=; b=V2OqIBJxykAN3tT5lbQznxCf2Rifd/cux53cg1ESYHW1va2PMj5HWD9sXFaCKnWoH7O7C/hpHSY5HZUNByj4e0MeLvr0l4HJpcEVe32vd/a2HQVvi570DAuOqj56FT/CheVuGBYi83xNfavlgBZ43Fqc0npvi793DEDNRhE0fLw= 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 1582788940915416.1895902441886; Wed, 26 Feb 2020 23:35:40 -0800 (PST) Received: from localhost ([::1]:54830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dhr-00066T-SN for importer@patchew.org; Thu, 27 Feb 2020 02:35:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42356) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dce-0000Gp-MJ for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcW-0000Am-Ic for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:14 -0500 Received: from relay.sw.ru ([185.231.240.75]:33962) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005Z-La; Thu, 27 Feb 2020 02:30:07 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcO-0003Tx-Ds; Thu, 27 Feb 2020 10:30:00 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 2/8] qcow2: rework the cluster compression routine Date: Thu, 27 Feb 2020 10:29:47 +0300 Message-Id: <20200227072953.25445-3-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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 --- block/qcow2-threads.c | 77 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c index 77bb578cdf..1c128e9840 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,19 +121,19 @@ 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 * * Returns: 0 on success - * -1 on fail + * -EIO on failure */ -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 =3D 0; z_stream strm; @@ -144,7 +146,7 @@ static ssize_t qcow2_decompress(void *dest, size_t dest= _size, =20 ret =3D inflateInit2(&strm, -12); if (ret !=3D Z_OK) { - return -1; + return -EIO; } =20 ret =3D inflate(&strm, Z_FINISH); @@ -154,7 +156,7 @@ static ssize_t qcow2_decompress(void *dest, size_t dest= _size, * @src buffer may be processed partly (because in qcow2 we know s= ize of * compressed data with precision of one sector) */ - ret =3D -1; + ret =3D -EIO; } =20 inflateEnd(&strm); @@ -189,20 +191,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: 0 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: + return -ENOTSUP; + } + + 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: + return -ENOTSUP; + } + + return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, fn); } =20 =20 --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788793; cv=none; d=zohomail.com; s=zohoarc; b=nWgTK0wPCKQGwSpZ42dmjdR9PxgAXN5t7t/ppHsgv3vn6Nr/7bUxWhKrKVfXuRkG5cyJAV+bBzuYgZh8CH9AxrFaxienjuwxCBSZg+FmhCCaL4tQw/TGF7ig6zfn9O6+lY/YX7PZ9qQJq50dyFyrbZRkMSBY7SXk/hi/oKsZ3NI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788793; 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=5GRjK28uabA53M0y+WIUpl/cfPPC/p2Jbr6noFZdOds=; b=edJw4kbD+c/c18AL05gndSL51vIVZtLHQ2bTtp4Jkjz14rDeed/gOMg/jJlCrqGJijVy0WnHgnUBNLuTPT96uSHZeOasXfLiVvQUap+PRQY837v24o0zviabW9NM+lEWjSxHGF3XNfwhcEv0yKWsPvGF+KQMhLlre+s5JgvN33A= 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 1582788793019173.56605351665496; Wed, 26 Feb 2020 23:33:13 -0800 (PST) Received: from localhost ([::1]:54804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7DfT-000363-HA for importer@patchew.org; Thu, 27 Feb 2020 02:33:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42316) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dca-0000GC-PK for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcV-00009L-1t for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:12 -0500 Received: from relay.sw.ru ([185.231.240.75]:33956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005d-Lz; Thu, 27 Feb 2020 02:30:06 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcO-0003Tx-JC; Thu, 27 Feb 2020 10:30:00 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 3/8] qcow2: add zstd cluster compression Date: Thu, 27 Feb 2020 10:29:48 +0300 Message-Id: <20200227072953.25445-4-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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 ------------------------------------------------------------ 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 --- block/qcow2-threads.c | 122 +++++++++++++++++++++++++++++++++++++++++ block/qcow2.c | 7 +++ configure | 29 ++++++++++ docs/interop/qcow2.txt | 18 ++++++ qapi/block-core.json | 3 +- 5 files changed, 178 insertions(+), 1 deletion(-) diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c index 1c128e9840..e942c4d7e5 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" @@ -164,6 +169,113 @@ static ssize_t qcow2_zlib_decompress(void *dest, size= _t dest_size, return ret; } =20 +#ifdef CONFIG_ZSTD + +#define ZSTD_LEN_BUF 4 + +/* + * 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) +{ + size_t ret; + + /* + * steal ZSTD_LEN_BUF bytes in the very beginng of the buffer + * to store compressed chunk size + */ + char *d_buf =3D ((char *) dest) + ZSTD_LEN_BUF; + + /* + * sanity check that we can store the compressed data length, + * and there is some space left for the compressor buffer + */ + if (dest_size <=3D ZSTD_LEN_BUF) { + return -ENOMEM; + } + + dest_size -=3D ZSTD_LEN_BUF; + + ret =3D ZSTD_compress(d_buf, dest_size, src, src_size, 5); + + if (ZSTD_isError(ret)) { + if (ZSTD_getErrorCode(ret) =3D=3D ZSTD_error_dstSize_tooSmall) { + return -ENOMEM; + } else { + return -EIO; + } + } + + /* paraniod sanity check that we can store the commpressed size */ + if (ret > UINT_MAX) { + return -ENOMEM; + } + + /* store the compressed chunk size in the very beginning of the buffer= */ + stl_be_p(dest, ret); + + return ret + ZSTD_LEN_BUF; +} + +/* + * 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) +{ + /* + * zstd decompress wants to know the exact length of the data. + * For that purpose, on compression, the length is stored in + * the very beginning of the compressed buffer + */ + size_t s_size; + const char *s_buf =3D ((const char *) src) + ZSTD_LEN_BUF; + + /* + * sanity check that we can read 4 byte the content length and + * and there is some content to decompress + */ + if (src_size <=3D ZSTD_LEN_BUF) { + return -EIO; + } + + s_size =3D ldl_be_p(src); + + /* sanity check that the buffer is big enough to read the content from= */ + if (src_size - ZSTD_LEN_BUF < s_size) { + return -EIO; + } + + if (ZSTD_isError( + ZSTD_decompress(dest, dest_size, s_buf, s_size))) { + return -EIO; + } + + return 0; +} +#endif + static int qcow2_compress_pool_func(void *opaque) { Qcow2CompressData *data =3D opaque; @@ -215,6 +327,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: return -ENOTSUP; } @@ -247,6 +364,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: return -ENOTSUP; } diff --git a/block/qcow2.c b/block/qcow2.c index 2ccb2cabd1..9c8ad9d580 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1257,6 +1257,9 @@ static int validate_compression_type(BDRVQcow2State *= s, Error **errp) =20 switch (s->compression_type) { case QCOW2_COMPRESSION_TYPE_ZLIB: +#ifdef CONFIG_ZSTD + case QCOW2_COMPRESSION_TYPE_ZSTD: +#endif break; =20 default: @@ -3506,6 +3509,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_errno(errp, -EINVAL, "Unknown compression type"); goto out; diff --git a/configure b/configure index 48d6f89d57..4690a7ea9f 100755 --- a/configure +++ b/configure @@ -444,6 +444,7 @@ opengl_dmabuf=3D"no" cpuid_h=3D"no" avx2_opt=3D"" zlib=3D"yes" +zstd=3D"" capstone=3D"" lzo=3D"" snappy=3D"" @@ -1371,6 +1372,10 @@ for opt do ;; --disable-lzfse) lzfse=3D"no" ;; + --enable-zstd) zstd=3D"yes" + ;; + --disable-zstd) zstd=3D"no" + ;; --enable-guest-agent) guest_agent=3D"yes" ;; --disable-guest-agent) guest_agent=3D"no" @@ -1829,6 +1834,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: (for reading bzip2-compressed dmg images) lzfse support of lzfse compression library (for reading lzfse-compressed dmg images) + zstd support of zstd compression library seccomp seccomp support coroutine-pool coroutine freelist (better performance) glusterfs GlusterFS backend @@ -2453,6 +2459,25 @@ EOF fi fi =20 +######################################### +# zstd check + +if test "$zstd" !=3D "no" ; then + cat > $TMPC << EOF +#include +int main(void) { ZSTD_versionNumber(); return 0; } +EOF + if compile_prog "" "-lzstd" ; then + LIBS=3D"$LIBS -lzstd" + zstd=3D"yes" + else + if test "$zstd" =3D "yes"; then + feature_not_found "zstd" "Install libzstd-devel" + fi + zstd=3D"no" + fi +fi + ########################################## # libseccomp check =20 @@ -6668,6 +6693,7 @@ echo "lzo support $lzo" echo "snappy support $snappy" echo "bzip2 support $bzip2" echo "lzfse support $lzfse" +echo "zstd support $zstd" echo "NUMA host support $numa" echo "libxml2 $libxml2" echo "tcmalloc support $tcmalloc" @@ -7559,6 +7585,9 @@ if test "$plugins" =3D "yes" ; then "\$ld_exported_symbols_list should have been set to 'yes'." fi fi +if test "$zstd" =3D "yes" ; then + echo "CONFIG_ZSTD=3Dy" >> $config_host_mak +fi =20 if test "$tcg_interpreter" =3D "yes"; then QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt index 5597e24474..aeca2ddebd 100644 --- a/docs/interop/qcow2.txt +++ b/docs/interop/qcow2.txt @@ -208,6 +208,7 @@ version 2. =20 Available compression type values: 0: zlib + 1: zstd =20 =20 =3D=3D=3D Header padding =3D=3D=3D @@ -575,11 +576,28 @@ Compressed Clusters Descriptor (x =3D 62 - (cluster_b= its - 8)): Another compressed cluster may map to the tail of the = final sector used by this compressed cluster. =20 + The layout of the compressed data depends on the compr= ession + type used for the image (see compressed cluster layout= ). + If a cluster is unallocated, read requests shall read the data from the ba= cking file (except if bit 0 in the Standard Cluster Descriptor is set). If there= is no backing file or the backing file is smaller than the image, they shall = read zeros for all parts that are not covered by the backing file. =20 +=3D=3D=3D Compressed Cluster Layout =3D=3D=3D + +The compressed cluster data has a layout depending on the compression +type used for the image, as follows: + +Compressed data layout for the available compression types: +(x =3D data_space_length - 1) + + 0: (default) zlib : + Byte 0 - x: the compressed data content + all the space provided used for compressed d= ata + 1: zstd : + Byte 0 - 3: the length of compressed data in bytes + 4 - x: the compressed data content =20 =3D=3D Snapshots =3D=3D =20 diff --git a/qapi/block-core.json b/qapi/block-core.json index 873fbef3b5..4b6e576c44 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4401,11 +4401,12 @@ # Compression type used in qcow2 image file # # @zlib: zlib compression, see +# @zstd: zstd compression, see # # Since: 5.0 ## { 'enum': 'Qcow2CompressionType', - 'data': [ 'zlib' ] } + 'data': [ 'zlib', { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] } =20 ## # @BlockdevCreateOptionsQcow2: --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788926; cv=none; d=zohomail.com; s=zohoarc; b=hbFx+JNP5YNiqlFYTivDCQbjkhRQCx3PfNDjl1kAEN/Y/Prt4LjQEuQ7Y+nZTf/EGJ6SyFRwoqaV4sH6EpWz+jy/XfeDqJh1EvVm3wAqy8/BVnh7EvPw1tYN6uaBYWkleqJVsP7edO54j8MRmJ8ib32tqkUlKnUAjIa1T9phbDw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788926; 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=EHJOf8MsnWTOT4Mj+Bytpxs/d6Lf2Yw8n1xqNJ7es/Y=; b=Y1jvHlS3IXMUqskHizSf5oIjtl5fqw+QWPA4FZW8xX/aqiZ38kGlsqyl5iTgNYgjqVfPjHj0tsQJ2G3P97H31LMxjg6i4BfbrkowpVJQfNtAodYaXrahLmek2hc71zp1iBGXb9TbP2DnvaOIfpGTUSlb2pppQG65nrhhGOiGBmc= 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 1582788926392207.5315134026323; Wed, 26 Feb 2020 23:35:26 -0800 (PST) Received: from localhost ([::1]:54826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dhb-0005ks-Br for importer@patchew.org; Thu, 27 Feb 2020 02:35:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42446) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dch-0000HM-Sl for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcW-0000Aw-Ij for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:18 -0500 Received: from relay.sw.ru ([185.231.240.75]:33954) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005X-Lc; Thu, 27 Feb 2020 02:30:07 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcO-0003Tx-OT; Thu, 27 Feb 2020 10:30:00 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 4/8] iotests: filter out compression_type Date: Thu, 27 Feb 2020 10:29:49 +0300 Message-Id: <20200227072953.25445-5-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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" After adding compression type feature to qcow2 format, qemu framework commands reporting the image settingd, e.g. "qemu-img create", started reporting the compression type for the image which breaks the iotests output matching. To fix it, add compression_type=3Dzlib to the list of filtered image parame= ters. Signed-off-by: Denis Plotnikov --- tests/qemu-iotests/common.filter | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 3f8ee3e5f7..c6962d199c 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=3Dzlib##g" } =20 _filter_img_info() --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582789015; cv=none; d=zohomail.com; s=zohoarc; b=ObIRHUN9fnDNAApDKJq3nTuUY/bjylv9CNGGmrJcp7wN7zYhbPXqHiZqrA+A8rw+sJAp3y5dJNoCY/qzvALgBM4ScJRYnS4M0YEERj0W/UB4OJJswmBCGxtB+LL2y56zSgzIUsV6OjqATj8NhoQAkv4Qx/ZVVlFHijcuw0EVo5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582789015; 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=PUMMCCplSS2gueBbwzzQGoJ5HNfj27SvtYMJ7POAFyc=; b=QMCnSQcpYuA5FoGnxtCStNiNDtaZmPSq6uJm0ANaG3d4jr40tBDcX1FG1V/3NW+BjDi9gIi4IhOZyxqyAgNCkvbGmxSTqw3T9ZT6xM3BlYgNaPf/+Q5u30uFzleeLrnwQ6O4GrN54KrQQssTSA10N/lXXbcYka4WVi6F+xTUGRs= 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 1582789015769193.70289553069847; Wed, 26 Feb 2020 23:36:55 -0800 (PST) Received: from localhost ([::1]:54862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dj4-0007jo-SF for importer@patchew.org; Thu, 27 Feb 2020 02:36:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42270) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7DcY-0000G3-La for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcW-0000AW-85 for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:10 -0500 Received: from relay.sw.ru ([185.231.240.75]:33970) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005e-LY; Thu, 27 Feb 2020 02:30:07 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcO-0003Tx-SL; Thu, 27 Feb 2020 10:30:00 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 5/8] iotests: fix header size, feature table size and backing file offset Date: Thu, 27 Feb 2020 10:29:50 +0300 Message-Id: <20200227072953.25445-6-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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" Affected tests: 031, 036, 061 Because of adding the compression type feature, some size values in the qcow2 v3 header are changed: header_size +=3D8: 1 byte compression type 7 bytes padding feature_table +=3D 48: incompatible feture compression type backing_file_offset +=3D 56 (8 + 48 -> header_change + fature_table_change) Change the values for the test output comparison accordingly. Signed-off-by: Denis Plotnikov --- tests/qemu-iotests/031.out | 14 +++++++------- tests/qemu-iotests/036.out | 4 ++-- tests/qemu-iotests/061.out | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/qemu-iotests/031.out b/tests/qemu-iotests/031.out index d535e407bc..ed51afe9ce 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 192 +length 240 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 192 +length 240 data =20 Header extension: @@ -164,7 +164,7 @@ No errors were found on the image. =20 magic 0x514649fb version 3 -backing_file_offset 0x178 +backing_file_offset 0x1b0 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 192 +length 240 data =20 Header extension: diff --git a/tests/qemu-iotests/036.out b/tests/qemu-iotests/036.out index 0b52b934e1..fb509f6357 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 192 +length 240 data =20 =20 @@ -38,7 +38,7 @@ compatible_features [] autoclear_features [] Header extension: magic 0x6803f857 -length 192 +length 240 data =20 *** done diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index 8b3091a412..cea7fedfdc 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 192 +length 240 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 192 +length 240 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 192 +length 240 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 192 +length 240 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 192 +length 240 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 192 +length 240 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 192 +length 240 data =20 read 131072/131072 bytes at offset 0 --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582789134; cv=none; d=zohomail.com; s=zohoarc; b=ZAeRYke4Bm4rLf/grmLrwO7RHkcDKfoDEl7Cne4UWw+eYCk8yiZ2YS+QP7a6xiT/qUy9FM3cgEylNnt6Hv/Q1MHTUnFdtp7fAjiCEU9GV3MwqdkxDmNkfsthGID5VZCrPxjMISQr8bGKSWzWxH14daqZAIMeNGwCP4gFsQtrb6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582789134; 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=0WcGz/Y4fZ8/eR8tS3HsgeLrCTIpG46u3hmIz+rByjE=; b=lTQWqx1zv7srpcfkriVIZUX1ZmGRMJl82qjCVvq1saAnUiwfB2yMzPJRaHv/Yhn0t4fgA8JD+fFpkmZ2aQDn/Vx0mEx7q/KBaUF1KJ1wg6+YOM3m0TUVBDa9QfFprGJteVY8hENrAs3c9jo/bicSVydZbu26/A7Y2YY1/DMv2hs= 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 1582789134246937.867636543773; Wed, 26 Feb 2020 23:38:54 -0800 (PST) Received: from localhost ([::1]:54876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dky-0000g1-GX for importer@patchew.org; Thu, 27 Feb 2020 02:38:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42354) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dcf-0000Gn-L4 for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcW-0000Ap-Il for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:12 -0500 Received: from relay.sw.ru ([185.231.240.75]:33968) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005c-La; Thu, 27 Feb 2020 02:30:07 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcP-0003Tx-1n; Thu, 27 Feb 2020 10:30:01 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 6/8] iotests: add "compression type" for test output matching Date: Thu, 27 Feb 2020 10:29:51 +0300 Message-Id: <20200227072953.25445-7-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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" Affected tests: 049, 060, 061, 065, 144, 182, 242, 255 After adding the compression type feature for qcow2, the compression type is reported on image quering. Add the corresponding values of the "compression type" for the tests' output matching. Signed-off-by: Denis Plotnikov --- tests/qemu-iotests/049.out | 102 ++++++++++++++++++------------------- tests/qemu-iotests/060.out | 1 + tests/qemu-iotests/061.out | 6 +++ tests/qemu-iotests/065 | 20 +++++--- tests/qemu-iotests/144.out | 4 +- tests/qemu-iotests/182.out | 2 +- tests/qemu-iotests/242.out | 5 ++ tests/qemu-iotests/255.out | 8 +-- 8 files changed, 82 insertions(+), 66 deletions(-) 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 d27692a33c..3e47f537e8 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 cea7fedfdc..c913f02ad6 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -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..106303b5a5 100755 --- a/tests/qemu-iotests/065 +++ b/tests/qemu-iotests/065 @@ -88,23 +88,25 @@ 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', 'refcoun= t 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, + 'compression-type': 'zlib' } + human_compare =3D [ 'compat: 1.1', 'compression type: zlib', 'lazy ref= counts: 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, + 'compression-type': 'zlib' } + human_compare =3D [ 'compat: 1.1', 'compression type: zlib', 'lazy ref= counts: true', 'refcount bits: 16', 'corrupt: false' ] =20 class TestQCow3NotLazyQMP(TestQMP): @@ -113,7 +115,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 +125,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/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/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) --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788754; cv=none; d=zohomail.com; s=zohoarc; b=RrbwvtMiv9FpHV+uebTKIdnP6qtgzcgf/iKvHvAlQxmbU8AfZTRVy7zh4JtXPavU7G+muqGsd1dtbhs/mtpg/yiRUfF5nkD451RUENSxXFU1YonVoQplLSCo0lePRnSkN8G575aE+Wtfru++GMq9wWYSAdoBtYSQy0tOTHVhKw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788754; 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=amjTn4FqGFgm3waLCcl5TN0ZUDnukO7K66lGB4lP8ok=; b=HbuGhA9wOxpdL+lAvZhZMib7NTiDTJOVDcKTj47n5N+9i11mrIPd4NIOlozMgLniFf2sOX0Z+Mxiz9qoTk/8R+CwxfXjTVC8wkGeTW4WJRhO5f4L0+/8BzEWKSYwAxOoWqM40+uZsENIaDR6/01ktwDcxyaGd7FsLAN1ER5lHFQ= 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 158278875383721.931547351378754; Wed, 26 Feb 2020 23:32:33 -0800 (PST) Received: from localhost ([::1]:54792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Deo-00027k-SF for importer@patchew.org; Thu, 27 Feb 2020 02:32:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42235) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7DcY-0000Fx-2g for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcU-000090-W3 for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:08 -0500 Received: from relay.sw.ru ([185.231.240.75]:33952) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005Y-1T; Thu, 27 Feb 2020 02:30:06 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcP-0003Tx-4j; Thu, 27 Feb 2020 10:30:01 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 7/8] iotests: 080: update header size value because of adding compression type Date: Thu, 27 Feb 2020 10:29:52 +0300 Message-Id: <20200227072953.25445-8-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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" Signed-off-by: Denis Plotnikov --- tests/qemu-iotests/080 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 --=20 2.17.0 From nobody Thu Nov 13 20:40:00 2025 Delivered-To: importer@patchew.org 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; 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=1582788758; cv=none; d=zohomail.com; s=zohoarc; b=AwQAfwq16ATmi5aNyQhjPufF4tzHXECTF0cm7e5g+MtssWBip+3OxNgaWtai5vCwF5U2aGARr25iY+oLKp+j3jjiKZoKC7E1CeedMLooBDcVyz/qybO1WgLm5L3ngPhIPFK6YVg+u2G5lVeR3Pz4SZaPaRFInr0BG9iKOKtJcTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582788758; 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=o0lyCl0YXIMX7drQKhBR0B23YlGlzO9C0SuaURkb99k=; b=TZNSf+hEo8KwnpPnnpE19MNfZ6KQon0jSHjwFg8dVgC2OHFUW7nyM21atpqYqFl/n3+/zYdZAio1mbrKvItOe+3dWfTmHN0NQ7W1yXXBukLwSvv52viM5q1tb3286qbZtYlbCqSAabDke2YHPiBSCZnzEH2Z2f7IHfVmiwe5/k4= 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 1582788758643883.973332104945; Wed, 26 Feb 2020 23:32:38 -0800 (PST) Received: from localhost ([::1]:54794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Dev-0002Fo-I4 for importer@patchew.org; Thu, 27 Feb 2020 02:32:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7DcY-0000G2-Lf for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7DcV-000098-0F for qemu-devel@nongnu.org; Thu, 27 Feb 2020 02:30:10 -0500 Received: from relay.sw.ru ([185.231.240.75]:33960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7DcU-00005a-1U; Thu, 27 Feb 2020 02:30:06 -0500 Received: from dptest2.qa.sw.ru ([10.94.4.71]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j7DcP-0003Tx-9R; Thu, 27 Feb 2020 10:30:01 +0300 From: Denis Plotnikov To: qemu-devel@nongnu.org Subject: [PATCH v1 8/8] iotests: 287: add qcow2 compression type test Date: Thu, 27 Feb 2020 10:29:53 +0300 Message-Id: <20200227072953.25445-9-dplotnikov@virtuozzo.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20200227072953.25445-1-dplotnikov@virtuozzo.com> References: <20200227072953.25445-1-dplotnikov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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, qemu-block@nongnu.org, den@vrtuozzo.com, armbru@redhat.com, mreitz@redhat.com 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 requiriements for the compression type feature and zstd compression type operability. Signed-off-by: Denis Plotnikov --- tests/qemu-iotests/287 | 123 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/287.out | 41 +++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 165 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..41b916f690 --- /dev/null +++ b/tests/qemu-iotests/287 @@ -0,0 +1,123 @@ +#!/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! + +_cleanup() +{ + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# standard environment +. ./common.rc +. ./common.filter + +# This tests qocw2-specific low-level functionality +_supported_fmt qcow2 +_supported_proto file +_supported_os Linux + +P=3D`echo "$QEMU_PROG" | sed "s/qemu-system-x86_64//"` + +grep "CONFIG_ZSTD=3Dy" "$P"../config-host.mak >/dev/null +RES=3D$? +if (($RES)); then + _notrun "ZSTD is disabled in the current configuration" +fi + +# Test: when compression is zlib the incompatible is unset +echo +echo "=3D=3D=3D Testing compression type incompatible bit setting for zlib= =3D=3D=3D" +echo + +_make_test_img 64M +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +# Test: when compression differs from zlib the incompatible bit is set +echo +echo "=3D=3D=3D Testing compression type incompatible bit setting for zstd= =3D=3D=3D" +echo + +IMGOPTS=3D'compression_type=3Dzstd' _make_test_img 64M +$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features + +# Test: an image can't be openned if compression type is zlib and +# incompatible feature compression type is set +echo +echo "=3D=3D=3D Testing zlib with incompatible bit set =3D=3D=3D" +echo + +IMGOPTS=3D'compression_type=3Dzlib' _make_test_img 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 +$QEMU_IMG info "$TEST_IMG" 2>1 1>/dev/null +if (($?=3D=3D0)); then + echo "Error: The image openned successfully. The image must not be ope= nned" +fi + +# Test: an image can't be openned if compression type is NOT zlib and +# incompatible feature compression type is UNSET +echo +echo "=3D=3D=3D Testing zstd with incompatible bit unset =3D=3D=3D" +echo + +IMGOPTS=3D'compression_type=3Dzstd' _make_test_img 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 +$QEMU_IMG info "$TEST_IMG" 2>1 1>/dev/null +if (($?=3D=3D0)); then + echo "Error: The image openned successfully. The image must not be ope= nned" +fi +# Test: check compression type values +echo +echo "=3D=3D=3D Testing compression type values =3D=3D=3D" +echo +# zlib=3D0 +IMGOPTS=3D'compression_type=3Dzlib' _make_test_img 64M +od -j104 -N1 -An -vtu1 "$TEST_IMG" + +# zstd=3D1 +IMGOPTS=3D'compression_type=3Dzstd' _make_test_img 64M +od -j104 -N1 -An -vtu1 "$TEST_IMG" + +# Test: using zstd compression, write to and read from an image +echo +echo "=3D=3D=3D Testing reading and writing with zstd =3D=3D=3D" +echo + +CLUSTER_SIZE=3D65536 +IMGOPTS=3D'compression_type=3Dzstd' _make_test_img 64M +$QEMU_IO -c "write -c 0 64k " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -v 0 10 " "$TEST_IMG" | _filter_qemu_io +$QEMU_IO -c "read -v 65530 8" "$TEST_IMG" | _filter_qemu_io + +# 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..4218254ce0 --- /dev/null +++ b/tests/qemu-iotests/287.out @@ -0,0 +1,41 @@ +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 compression_t= ype=3Dzstd +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 compression_t= ype=3Dzstd +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 compression_t= ype=3Dzstd + 1 + +=3D=3D=3D Testing reading and writing with zstd =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 compression_t= ype=3Dzstd +wrote 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +00000000: cd cd cd cd cd cd cd cd cd cd .......... +read 10/10 bytes at offset 0 +10 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +0000fffa: cd cd cd cd cd cd 00 00 ........ +read 8/8 bytes at offset 65530 +8 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 0317667695..5edbadef40 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -293,3 +293,4 @@ 283 auto quick 284 rw 286 rw quick +287 auto quick --=20 2.17.0