From 5edc931726d415e719ada5df5453fd718cedda95 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sun, 12 May 2024 23:17:50 +0100 Subject: [PATCH] feat: check if VM launched successfully; if not show the logs --- quickemu | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickemu b/quickemu index e8c916971f..4fb5694ae6 100755 --- a/quickemu +++ b/quickemu @@ -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 }