Catch missing disk configuration early

This commit is contained in:
Martin Wimpress 2020-03-20 18:16:08 +00:00
parent 31c02550d3
commit d48dc74e95
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 5 additions and 6 deletions

View File

@ -54,12 +54,7 @@ function vm_boot() {
echo "Starting ${VM}"
echo " - QEMU: ${QEMU} v${QEMU_VER}"
if [ -z "${disk_img}" ]; then
echo "ERROR! No disk_img defined."
exit 1
fi
readonly disk_min_size=395264
readonly disk_min_size=$((197632 * 8))
if [ -z "${disk}" ]; then
disk="64G"
fi
@ -240,6 +235,10 @@ fi
if [ -n "${VM}" ] || [ -e "${VM}" ]; then
source "${VM}"
if [ -z "${disk_img}" ]; then
echo "ERROR! No disk_img defined."
exit 1
fi
else
echo "ERROR! Virtual machine configuration not found."
usage