[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 05/12] iotests/common.rc: add disk_usage function
From: |
Andrey Drobyshev |
Subject: |
[PATCH v3 05/12] iotests/common.rc: add disk_usage function |
Date: |
Fri, 13 Sep 2024 19:39:35 +0300 |
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>
---
tests/qemu-iotests/250 | 5 -----
tests/qemu-iotests/common.rc | 6 ++++++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/250 b/tests/qemu-iotests/250
index af48f83aba..c0a0dbc0ff 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
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 95c12577dd..237f746af8 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
--
2.39.3
- [PATCH v3 00/12] qcow2: make subclusters discardable, Andrey Drobyshev, 2024/09/13
- [PATCH v3 02/12] qcow2: simplify L2 entries accounting for discard-no-unref, Andrey Drobyshev, 2024/09/13
- [PATCH v3 04/12] block/file-posix: add trace event for fallocate() calls, Andrey Drobyshev, 2024/09/13
- [PATCH v3 01/12] qcow2: make function update_refcount_discard() global, Andrey Drobyshev, 2024/09/13
- [PATCH v3 09/12] qcow2: make subclusters discardable, Andrey Drobyshev, 2024/09/13
- [PATCH v3 06/12] iotests/290: add test case to check 'discard-no-unref' option behavior, Andrey Drobyshev, 2024/09/13
- [PATCH v3 07/12] qcow2: add get_sc_range_info() helper for working with subcluster ranges, Andrey Drobyshev, 2024/09/13
- [PATCH v3 08/12] qcow2: zeroize the entire cluster when there're no non-zero subclusters, Andrey Drobyshev, 2024/09/13
- [PATCH v3 03/12] qcow2: put discard requests in the common queue when discard-no-unref enabled, Andrey Drobyshev, 2024/09/13
- [PATCH v3 05/12] iotests/common.rc: add disk_usage function,
Andrey Drobyshev <=
- [PATCH v3 12/12] qcow2: add discard-subclusters option, Andrey Drobyshev, 2024/09/13
- [PATCH v3 10/12] qcow2: zero_l2_subclusters: fall through to discard operation when requested, Andrey Drobyshev, 2024/09/13
- [PATCH v3 11/12] iotests/271: add test cases for subcluster-based discard/unmap, Andrey Drobyshev, 2024/09/13
- Re: [PATCH v3 00/12] qcow2: make subclusters discardable, Andrey Drobyshev, 2024/09/30