]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Relax qemu check in uncaught_exception_handler() 2142/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 9 Dec 2023 11:51:46 +0000 (12:51 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 9 Dec 2023 13:06:07 +0000 (14:06 +0100)
qemu binaries can have many different names (qemu, qemu-kvm,
qemu-system-xxx, ...) so let's not log a stacktrace for any binary
that starts with "qemu".

mkosi/run.py

index 6ee9f0304ccb982d3b548e01c6714bec3181e980..19f714b8b32f660022e4efda92c3485543af4c12 100644 (file)
@@ -182,7 +182,12 @@ def uncaught_exception_handler(exit: Callable[[int], NoReturn]) -> Iterator[None
         # Failures from qemu, ssh and systemd-nspawn are expected and we won't log stacktraces for those.
         # Failures from self come from the forks we spawn to build images in a user namespace. We've already done all
         # the logging for those failures so we don't log stacktraces for those either.
-        if ARG_DEBUG.get() and e.cmd and e.cmd[0] not in ("self", "qemu", "ssh", "systemd-nspawn"):
+        if (
+            ARG_DEBUG.get() and
+            e.cmd and
+            e.cmd[0] not in ("self", "ssh", "systemd-nspawn") and
+            not e.cmd[0].startswith("qemu")
+        ):
             sys.excepthook(*ensure_exc_info())
 
         # We always log when subprocess.CalledProcessError is raised, so we don't log again here.