From a688c798f531db6e1705ab07dc82ee5f44b81fc9 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Fri, 20 Mar 2020 14:22:22 +0000 Subject: [PATCH] Correct disk creation/enumeration order --- quickemu | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/quickemu b/quickemu index fdcb154..0956b6c 100755 --- a/quickemu +++ b/quickemu @@ -82,9 +82,7 @@ function vm_boot() { fi echo " - Disk: ${disk_img} (${disk})" - if [ -e ${disk_img} ] && [ ${disk_curr_size} -le ${disk_min_size} ]; then - echo " Looks unused, booting from ${iso}" - elif [ ! -f "${disk_img}" ]; then + if [ ! -f "${disk_img}" ]; then # If there is no disk image, create a new image. ${QEMU_IMG} create -q -f qcow2 "${disk_img}" "${disk}" echo " Just created, booting from ${iso}" @@ -92,8 +90,11 @@ function vm_boot() { echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here." exit 1 fi + elif [ -e ${disk_img} ] && [ ${disk_curr_size} -le ${disk_min_size} ]; then + echo " Looks unused, booting from ${iso}" else - # If there is a disk image, do not boot from the iso + # If there is a disk image, that appears to have an install + # then do not boot from the iso iso="" fi if [ -e ${disk_img_snapshot} ]; then