Surface daemonized QEMU launch errors from the -D logfile
This commit is contained in:
parent
0dfee9a589
commit
08f5e4329e
@ -173,7 +173,13 @@ async def spawn_vm(cfg: VMConfig, config: Config) -> VMRecord:
|
|||||||
)
|
)
|
||||||
_, stderr = await proc.communicate()
|
_, stderr = await proc.communicate()
|
||||||
if proc.returncode != 0:
|
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}")
|
raise ToolError(f"QEMU failed to launch VM {cfg.name!r}: {detail}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user