From 08f5e4329e05620f6cd469ef9d39e7c0ce3317d6 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Sun, 16 Aug 2026 22:10:08 -0600 Subject: [PATCH] Surface daemonized QEMU launch errors from the -D logfile --- src/mcqemu/launcher.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mcqemu/launcher.py b/src/mcqemu/launcher.py index 7c0356b..66b1fad 100644 --- a/src/mcqemu/launcher.py +++ b/src/mcqemu/launcher.py @@ -173,7 +173,13 @@ async def spawn_vm(cfg: VMConfig, config: Config) -> VMRecord: ) _, stderr = await proc.communicate() if proc.returncode != 0: - detail = stderr.decode(errors="replace").strip() or f"exit code {proc.returncode}" + detail = stderr.decode(errors="replace").strip() + if not detail: + # Daemonized QEMU routes errors to the -D logfile, not stderr. + try: + detail = paths.qemu_log.read_text().strip().splitlines()[-1] + except (OSError, IndexError): + detail = f"exit code {proc.returncode}" raise ToolError(f"QEMU failed to launch VM {cfg.name!r}: {detail}") try: