Skip to content

Commit ac097c1

Browse files
committed
qemudriver: record QEMU stderr in exception message
When starting QEMU fails, e.g. because of a wrong command line option, its stderr is not printed by default. Fix this to make debugging startup issues easier. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent c0becf3 commit ac097c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labgrid/driver/qemudriver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ def on(self):
273273
self.qmp = QMPMonitor(self._child.stdout, self._child.stdin)
274274
except QMPError as exc:
275275
if self._child.poll() is not None:
276-
self._child.communicate()
276+
_, err = self._child.communicate()
277277
raise IOError(
278-
f"QEMU process terminated with exit code {self._child.returncode}"
278+
f"QEMU error: {err} (exitcode={self._child.returncode})"
279279
) from exc
280280
raise
281281

0 commit comments

Comments
 (0)