Skip to content

Commit

Permalink
feat: check if VM launched successfully; if not show the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg authored and philclifford committed May 13, 2024
1 parent 12edf97 commit d55d401
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,14 @@ function vm_boot() {
${QEMU} "${args[@]}" &> "${VMDIR}/${VMNAME}.log" &
local VM_PID=$!
sleep 0.25
echo " - Process: Starting ${VM} as ${VMNAME} (${VM_PID})"
if kill -0 "${VM_PID}" 2>/dev/null; then
echo " - Process: Started ${VM} as ${VMNAME} (${VM_PID})"
else
echo " - Process: ERROR! Failed to start ${VM} as ${VMNAME}"
rm -f "${VMDIR}/${VMNAME}.pid"
echo && cat "${VMDIR}/${VMNAME}.log"
exit 1
fi
fi
}

Expand Down

0 comments on commit d55d401

Please sign in to comment.