From: Hanna Reitz <hreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
Hanna Reitz <hreitz@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org
Subject: [PATCH v2 1/3] iotests.py: Add supports_qcow2_zstd_compression()
Date: Wed, 2 Mar 2022 13:45:38 +0100 [thread overview]
Message-ID: <20220302124540.45083-2-hreitz@redhat.com> (raw)
In-Reply-To: <20220302124540.45083-1-hreitz@redhat.com>
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/iotests.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 6027780180..ce60abcadc 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -1377,6 +1377,27 @@ def verify_working_luks():
if not working:
notrun(reason)
+def supports_qcow2_zstd_compression() -> bool:
+ img_file = f'{test_dir}/qcow2-zstd-test.qcow2'
+ (output, status) = \
+ qemu_img_pipe_and_status('create', '-f', 'qcow2',
+ '-o', 'compression_type=zstd',
+ img_file, '0')
+ try:
+ os.remove(img_file)
+ except OSError:
+ pass
+
+ if status == 1 and \
+ "'compression-type' does not accept value 'zstd'" in output:
+ return False
+ else:
+ return True
+
+def verify_qcow2_zstd_compression():
+ if not supports_qcow2_zstd_compression():
+ notrun('zstd compression not supported')
+
def qemu_pipe(*args: str) -> str:
"""
Run qemu with an option to print something and exit (e.g. a help option).
--
2.34.1
next prev parent reply other threads:[~2022-03-02 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 12:45 [PATCH v2 0/3] iotests: Check for zstd support Hanna Reitz
2022-03-02 12:45 ` Hanna Reitz [this message]
2022-03-02 12:45 ` [PATCH v2 2/3] iotests/065: " Hanna Reitz
2022-03-02 12:45 ` [PATCH v2 3/3] iotests/303: " Hanna Reitz
2022-03-22 9:48 ` [PATCH v2 0/3] iotests: " Hanna Reitz
2022-03-22 10:50 ` Vladimir Sementsov-Ogievskiy
2022-03-22 9:56 ` Thomas Huth
2022-03-23 10:46 ` Hanna Reitz
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=20220302124540.45083-2-hreitz@redhat.com \
--to=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).