From: Max Reitz Date: Wed, 25 Sep 2019 18:32:31 +0000 (+0200) Subject: iotests: Use stat -c %b in 125 X-Git-Tag: qemu-xen-4.14.0~354^2~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f2d86ade4da71d1f32ffc5977ea5417c20996919;p=qemu-xen.git iotests: Use stat -c %b in 125 125 should not use qemu-img to get the on-disk image size, because that reports it in a human-readable format that is useless to us. Just use stat instead (like we do to get the image file length). Signed-off-by: Max Reitz Message-id: 20190925183231.11196-4-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- diff --git a/tests/qemu-iotests/125 b/tests/qemu-iotests/125 index 0ef51f1e21..4e31aa4e5f 100755 --- a/tests/qemu-iotests/125 +++ b/tests/qemu-iotests/125 @@ -34,8 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 get_image_size_on_host() { - $QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep "disk size" \ - | sed -e 's/^[^0-9]*\([0-9]\+\).*$/\1/' + echo $(($(stat -c '%b * %B' "$TEST_IMG_FILE"))) } # get standard environment and filters