Catch disk image creation errors

This commit is contained in:
Martin Wimpress 2020-03-19 15:26:21 +00:00
parent 3b5fdcb6ea
commit 01688b3ab5
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -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