fix: capture and displaying the PID when launching a VM

This commit is contained in:
Martin Wimpress 2024-05-12 14:49:37 +01:00 committed by Martin Wimpress
parent bc399df328
commit a9576fb3a4
1 changed files with 2 additions and 1 deletions

View File

@ -1311,8 +1311,9 @@ function vm_boot() {
echo "${QEMU}" "${SHELL_ARGS}" "2>/dev/null" >> "${VMDIR}/${VMNAME}.sh"
sed -i -e 's/ -/ \\\n -/g' "${VMDIR}/${VMNAME}.sh"
${QEMU} "${args[@]}" &> "${VMDIR}/${VMNAME}.log" &
local VM_PID=$!
sleep 0.25
echo " - Process: Starting ${VM} as ${VMNAME} ($(cat "${VMDIR}/${VMNAME}.pid"))"
echo " - Process: Starting ${VM} as ${VMNAME} (${VM_PID})"
fi
}