fix: only check the disk write lock if there is no PID for the VM

This commit is contained in:
Martin Wimpress 2024-05-11 12:15:23 +01:00 committed by Martin Wimpress
parent 1ae4af6244
commit 58599a98ab
1 changed files with 1 additions and 1 deletions

View File

@ -662,7 +662,7 @@ function vm_boot() {
fi
echo " Just created, booting from ${iso}${img}"
DISK_USED="no"
elif [ -e "${disk_img}" ]; then
elif [ -e "${disk_img}" ] && [ -z "${VM_PID}" ]; then
# Check there isn't already a process attached to the disk image.
if ! ${QEMU_IMG} info "${disk_img}" >/dev/null; then
echo " Failed to get \"write\" lock. Is another process using the disk?"