From d48dc74e95bf7a13123ea0716cb7ffa2e400fcc1 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Fri, 20 Mar 2020 18:16:08 +0000 Subject: [PATCH] Catch missing disk configuration early --- quickemu | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/quickemu b/quickemu index 6960d7f..434e479 100755 --- a/quickemu +++ b/quickemu @@ -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