Skip to content

Commit

Permalink
add disk health check
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxVinyards authored and zen0bit committed Apr 9, 2024
1 parent 030e60a commit 0e4fc7e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,14 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
exit 1
fi

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

VMDIR=$(dirname "${disk_img}")
VMNAME=$(basename "${VM}" .conf)
VMPATH=$(realpath "$(dirname "${VM}")")
Expand Down

0 comments on commit 0e4fc7e

Please sign in to comment.