From d030221214b89370ab0f5a196562639c1bb9808e Mon Sep 17 00:00:00 2001 From: Alex Genovese Date: Fri, 12 Apr 2024 08:02:39 +0200 Subject: [PATCH] revised health checker milliseconds, almost instant ... fix for earlier pr which failed on new installs if disk was not present #848 --- quickemu | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/quickemu b/quickemu index 84c2e23..d0e292d 100755 --- a/quickemu +++ b/quickemu @@ -1770,6 +1770,15 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then exit 1 fi + if [ -e "${disk_img}" ]; then + DiskChkMsg="$("$QEMU_IMG" check -q "${disk_img}" 2>&1)" + if [[ $DiskChkMsg ]]; then + echo; echo "ERROR! disk.qcow2 has problems. Try qemu-img check --help." + echo; echo "$DiskChkMsg" ; echo + exit 1 + fi + fi + VMDIR=$(dirname "${disk_img}") VMNAME=$(basename "${VM}" .conf) VMPATH=$(realpath "$(dirname "${VM}")")