From aced2c06a0aa95e1401fe821b60996303b76d571 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 14 Oct 2020 16:29:45 +0800 Subject: [PATCH] selftest: Always use the get_image_fmt helper Avoid code duplication. --- tests/scripts/image-init-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scripts/image-init-lib.sh b/tests/scripts/image-init-lib.sh index 7be55d1..09ad940 100644 --- a/tests/scripts/image-init-lib.sh +++ b/tests/scripts/image-init-lib.sh @@ -232,7 +232,7 @@ create_image_from_base_image() { image=$decompressed_image fi - local image_fmt=$(qemu-img info $image | sed -n "s/file format:\s*\(.*\)/\1/p") + local image_fmt=$(get_image_fmt $image) if [ "$image_fmt" != "raw" ]; then if [ "$image_fmt" == "qcow2" ]; then echo "Source image is qcow2, using snapshot..."