Correct disk creation/enumeration order

This commit is contained in:
Martin Wimpress 2020-03-20 14:22:22 +00:00
parent 38307c1c0f
commit a688c798f5
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

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