From 8c64195f67c3926b2940ee2790a3ceeb8aed94f3 Mon Sep 17 00:00:00 2001 From: Michel Thebeau Date: Mon, 10 Jul 2023 13:57:19 -0400 Subject: [PATCH] libvirt: update QCOW image detection The script enforces the kind of file it will delete to prevent accidents. Update the detection of QCOW disk images for QCOW2. On an updated Ubuntu the file type is "QCOW2" instead of "QCOW". Change-Id: If6ab7113358f96749dadae53b52ae31e8f452777 Signed-off-by: Michel Thebeau --- libvirt/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt/functions.sh b/libvirt/functions.sh index b367615..479cb75 100644 --- a/libvirt/functions.sh +++ b/libvirt/functions.sh @@ -68,7 +68,7 @@ delete_disk() { return 1 fi - file -b "$fpath" | grep -q "^QEMU QCOW Image (v3)," + file -b "$fpath" | grep -q "^QEMU \(QCOW\|QCOW2\) Image (v3)," if [ $? -ne 0 ]; then echo "file to delete is not QEMU QCOW Image (v3): $fpath" >&2 return 1