From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 02/15] qemu-iotests: allow qcow2 external discarded clusters to contain stale data
Date: Thu, 30 Apr 2020 17:52:18 +0200 [thread overview]
Message-ID: <20200430155231.473156-3-kwolf@redhat.com> (raw)
In-Reply-To: <20200430155231.473156-1-kwolf@redhat.com>
From: Paolo Bonzini <pbonzini@redhat.com>
Test 244 checks the expected behavior of qcow2 external data files
with respect to zero and discarded clusters. Filesystems however
are free to ignore discard requests, and this seems to be the
case for overlayfs. Relax the tests to skip checks on the
external data file for discarded areas, which implies not using
qemu-img compare in the data_file_raw=on case.
This fixes docker tests on RHEL8.
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200409191006.24429-1-pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/244 | 10 ++++++++--
tests/qemu-iotests/244.out | 9 ++++++---
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244
index 2ec1815e6f..efe3c0428b 100755
--- a/tests/qemu-iotests/244
+++ b/tests/qemu-iotests/244
@@ -143,7 +143,6 @@ $QEMU_IO -c 'read -P 0 0 1M' \
echo
$QEMU_IO -c 'read -P 0 0 1M' \
-c 'read -P 0x11 1M 1M' \
- -c 'read -P 0 2M 2M' \
-c 'read -P 0x11 4M 1M' \
-c 'read -P 0 5M 1M' \
-f raw "$TEST_IMG.data" |
@@ -180,8 +179,15 @@ $QEMU_IO -c 'read -P 0 0 1M' \
-f $IMGFMT "$TEST_IMG" |
_filter_qemu_io
+# Discarded clusters are only marked as such in the qcow2 metadata, but
+# they can contain stale data in the external data file. Instead, zero
+# clusters must be zeroed in the external data file too.
echo
-$QEMU_IMG compare "$TEST_IMG" "$TEST_IMG.data"
+$QEMU_IO -c 'read -P 0 0 1M' \
+ -c 'read -P 0x11 1M 1M' \
+ -c 'read -P 0 3M 3M' \
+ -f raw "$TEST_IMG".data |
+ _filter_qemu_io
echo -n "qcow2 file size after I/O: "
du -b $TEST_IMG | cut -f1
diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out
index 56329deb4b..dbab7359a9 100644
--- a/tests/qemu-iotests/244.out
+++ b/tests/qemu-iotests/244.out
@@ -74,8 +74,6 @@ read 1048576/1048576 bytes at offset 0
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 2097152/2097152 bytes at offset 2097152
-2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 4194304
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 5242880
@@ -108,7 +106,12 @@ read 1048576/1048576 bytes at offset 1048576
read 4194304/4194304 bytes at offset 2097152
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Images are identical.
+read 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 1048576/1048576 bytes at offset 1048576
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 3145728/3145728 bytes at offset 3145728
+3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
qcow2 file size after I/O: 327680
=== bdrv_co_block_status test for file and offset=0 ===
--
2.25.3
next prev parent reply other threads:[~2020-04-30 15:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 15:52 [PULL 00/15] Block layer patches Kevin Wolf
2020-04-30 15:52 ` [PULL 01/15] qcow2: Add incompatibility note between backing files and raw external data files Kevin Wolf
2020-04-30 15:52 ` Kevin Wolf [this message]
2020-04-30 15:52 ` [PULL 03/15] block: Add flags to BlockDriver.bdrv_co_truncate() Kevin Wolf
2020-04-30 15:52 ` [PULL 04/15] block: Add flags to bdrv(_co)_truncate() Kevin Wolf
2020-04-30 15:52 ` [PULL 05/15] block-backend: Add flags to blk_truncate() Kevin Wolf
2020-04-30 15:52 ` [PULL 06/15] qcow2: Support BDRV_REQ_ZERO_WRITE for truncate Kevin Wolf
2020-04-30 15:52 ` [PULL 07/15] raw-format: " Kevin Wolf
2020-04-30 15:52 ` [PULL 08/15] file-posix: " Kevin Wolf
2020-04-30 15:52 ` [PULL 09/15] block: truncate: Don't make backing file data visible Kevin Wolf
2020-04-30 15:52 ` [PULL 10/15] iotests: Filter testfiles out in filter_img_info() Kevin Wolf
2020-04-30 15:52 ` [PULL 11/15] iotests: Test committing to short backing file Kevin Wolf
2020-04-30 15:52 ` [PULL 12/15] qcow2: Forward ZERO_WRITE flag for full preallocation Kevin Wolf
2020-04-30 15:52 ` [PULL 13/15] nvme: introduce PMR support from NVMe 1.4 spec Kevin Wolf
2020-04-30 15:52 ` [PULL 14/15] qom: Factor out user_creatable_add_dict() Kevin Wolf
2020-04-30 15:52 ` [PULL 15/15] qemu-storage-daemon: Fix non-string --object properties Kevin Wolf
2020-05-01 9:27 ` [PULL 00/15] Block layer patches Peter Maydell
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=20200430155231.473156-3-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).