From: Markus Armbruster <armbru@redhat.com>
To: Denis Plotnikov <dplotnikov@virtuozzo.com>
Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, berto@igalia.com,
qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
den@openvz.org
Subject: Re: [PATCH v5 2/5] qcow2: introduce compression type feature
Date: Wed, 04 Mar 2020 15:56:27 +0100 [thread overview]
Message-ID: <87d09si2xw.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20200304133538.9159-3-dplotnikov@virtuozzo.com> (Denis Plotnikov's message of "Wed, 4 Mar 2020 16:35:35 +0300")
Denis Plotnikov <dplotnikov@virtuozzo.com> writes:
> The patch adds some preparation parts for incompatible compression type
> feature to qcow2 allowing the use different compression methods for
> image clusters (de)compressing.
>
> It is implied that the compression type is set on the image creation and
> can be changed only later by image conversion, thus compression type
> defines the only compression algorithm used for the image, and thus,
> for all image clusters.
>
> The goal of the feature is to add support of other compression methods
> to qcow2. For example, ZSTD which is more effective on compression than ZLIB.
>
> The default compression is ZLIB. Images created with ZLIB compression type
> are backward compatible with older qemu versions.
>
> Adding of the compression type breaks a number of tests because now the
> compression type is reported on image creation and there are some changes
> in the qcow2 header in size and offsets.
>
> The tests are fixed in the following ways:
> * filter out compression_type for all the tests
> * fix header size, feature table size and backing file offset
> affected tests: 031, 036, 061, 080
> header_size +=8: 1 byte compression type
> 7 bytes padding
> feature_table += 48: incompatible feture compression type
> backing_file_offset += 56 (8 + 48 -> header_change + fature_table_change)
> * add "compression type" for test output matching when it isn't filtered
> affected tests: 049, 060, 061, 065, 144, 182, 242, 255
>
> Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> qapi/block-core.json | 22 ++++++-
> block/qcow2.h | 18 +++++-
> include/block/block_int.h | 1 +
> block/qcow2.c | 101 ++++++++++++++++++++++++++++++
> tests/qemu-iotests/031.out | 14 ++---
> tests/qemu-iotests/036.out | 4 +-
> tests/qemu-iotests/049.out | 102 +++++++++++++++----------------
> tests/qemu-iotests/060.out | 1 +
> tests/qemu-iotests/061.out | 34 ++++++-----
> tests/qemu-iotests/065 | 28 ++++++---
> tests/qemu-iotests/080 | 2 +-
> tests/qemu-iotests/144.out | 4 +-
> tests/qemu-iotests/182.out | 2 +-
> tests/qemu-iotests/242.out | 5 ++
> tests/qemu-iotests/255.out | 8 +--
> tests/qemu-iotests/common.filter | 3 +-
> 16 files changed, 253 insertions(+), 96 deletions(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 85e27bb61f..a67eb8bff4 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'
> } }
>
> ##
> @@ -4392,6 +4395,18 @@
> 'data': [ 'v2', 'v3' ] }
>
>
> +##
> +# @Qcow2CompressionType:
> +#
> +# Compression type used in qcow2 image file
> +#
> +# @zlib: zlib compression, see <http://zlib.net/>
> +#
> +# 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' } }
>
> ##
> # @BlockdevCreateOptionsQed:
[...]
QAPI part:
Acked-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2020-03-04 14:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 13:35 [PATCH v5 0/5] qcow2: Implement zstd cluster compression method Denis Plotnikov
2020-03-04 13:35 ` [PATCH v5 1/5] block/qcow2-threads: fix qcow2_decompress Denis Plotnikov
2020-03-04 13:35 ` [PATCH v5 2/5] qcow2: introduce compression type feature Denis Plotnikov
2020-03-04 14:56 ` Markus Armbruster [this message]
2020-03-05 19:11 ` Alberto Garcia
2020-03-04 13:35 ` [PATCH v5 3/5] qcow2: rework the cluster compression routine Denis Plotnikov
2020-03-06 10:31 ` Alberto Garcia
2020-03-04 13:35 ` [PATCH v5 4/5] qcow2: add zstd cluster compression Denis Plotnikov
2020-03-05 9:56 ` Vladimir Sementsov-Ogievskiy
2020-03-05 12:10 ` Markus Armbruster
2020-03-06 10:49 ` Alberto Garcia
2020-03-04 13:35 ` [PATCH v5 5/5] iotests: 287: add qcow2 compression type test Denis Plotnikov
2020-03-11 7:31 ` [PATCH v5 0/5] qcow2: Implement zstd cluster compression method Denis Plotnikov
[not found] ` <55afec29-1726-c36a-6d80-3dbd1839f0a6@redhat.com>
2020-03-11 17:30 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d09si2xw.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berto@igalia.com \
--cc=den@openvz.org \
--cc=dplotnikov@virtuozzo.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.