[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/14] iotests/common.rc: add disk_usage function
From: |
Eric Blake |
Subject: |
[PULL 12/14] iotests/common.rc: add disk_usage function |
Date: |
Wed, 14 May 2025 21:28:55 -0500 |
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Move the definition from iotests/250 to common.rc. This is used to
detect real disk usage of sparse files. In particular, we want to use
it for checking subclusters-based discards.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-ID: <20240913163942.423050-6-andrey.drobyshev@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20250509204341.3553601-27-eblake@redhat.com>
---
tests/qemu-iotests/common.rc | 6 ++++++
tests/qemu-iotests/250 | 5 -----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 95c12577dd4..237f746af88 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -140,6 +140,12 @@ _optstr_add()
fi
}
+# report real disk usage for sparse files
+disk_usage()
+{
+ du --block-size=1 "$1" | awk '{print $1}'
+}
+
# Set the variables to the empty string to turn Valgrind off
# for specific processes, e.g.
# $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015
diff --git a/tests/qemu-iotests/250 b/tests/qemu-iotests/250
index af48f83abac..c0a0dbc0ff1 100755
--- a/tests/qemu-iotests/250
+++ b/tests/qemu-iotests/250
@@ -52,11 +52,6 @@ _unsupported_imgopts data_file
# bdrv_co_truncate(bs->file) call in qcow2_co_truncate(), which might succeed
# anyway.
-disk_usage()
-{
- du --block-size=1 $1 | awk '{print $1}'
-}
-
size=2100M
_make_test_img -o "cluster_size=1M,preallocation=metadata" $size
--
2.49.0
- [PULL 00/14] NBD patches for 2025-05-14, Eric Blake, 2025/05/14
- [PULL 02/14] file-posix, gluster: Handle zero block status hint better, Eric Blake, 2025/05/14
- [PULL 01/14] block: Expand block status mode from bool to flags, Eric Blake, 2025/05/14
- [PULL 03/14] block: Let bdrv_co_is_zero_fast consolidate adjacent extents, Eric Blake, 2025/05/14
- [PULL 05/14] iotests: Improve iotest 194 to mirror data, Eric Blake, 2025/05/14
- [PULL 04/14] block: Add new bdrv_co_is_all_zeroes() function, Eric Blake, 2025/05/14
- [PULL 06/14] mirror: Minor refactoring, Eric Blake, 2025/05/14
- [PULL 09/14] mirror: Drop redundant zero_target parameter, Eric Blake, 2025/05/14
- [PULL 10/14] mirror: Skip pre-zeroing destination if it is already zero, Eric Blake, 2025/05/14
- [PULL 11/14] mirror: Skip writing zeroes when target is already zero, Eric Blake, 2025/05/14
- [PULL 12/14] iotests/common.rc: add disk_usage function,
Eric Blake <=
- [PULL 07/14] mirror: Pass full sync mode rather than bool to internals, Eric Blake, 2025/05/14
- [PULL 08/14] mirror: Allow QMP override to declare target already zero, Eric Blake, 2025/05/14
- [PULL 13/14] tests: Add iotest mirror-sparse for recent patches, Eric Blake, 2025/05/14
- [PULL 14/14] mirror: Reduce I/O when destination is detect-zeroes:unmap, Eric Blake, 2025/05/14
- Re: [PULL 00/14] NBD patches for 2025-05-14, Stefan Hajnoczi, 2025/05/17