From 01688b3ab58cee2b41a56c677cd635a0c3ba85e2 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Thu, 19 Mar 2020 15:26:21 +0000 Subject: [PATCH] Catch disk image creation errors --- quickemu.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quickemu.sh b/quickemu.sh index a8482d9..9f909ae 100755 --- a/quickemu.sh +++ b/quickemu.sh @@ -56,6 +56,10 @@ function vm_boot() { if [ ! -f "${disk_img}" ]; then # If there is no disk image, create a new image. qemu-img create -q -f qcow2 "${disk_img}" "${disk}" + if [ $? -ne 0 ]; then + echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here." + exit 1 + fi echo " - ISO: ${iso}" else # If there is a disk image, do not boot from the iso