mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
iotests/common.rc: add disk_usage function
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 <[email protected]> Reviewed-by: Alexander Ivanov <[email protected]> Reviewed-by: Alberto Garcia <[email protected]> Message-ID: <[email protected]> Signed-off-by: Eric Blake <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Message-ID: <[email protected]>
This commit is contained in:
1 parent
7e277545b9
commit
be9bac072e
2 files changed
+6
-5
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user