From: Daan De Meyer Date: Sat, 9 Dec 2023 11:51:46 +0000 (+0100) Subject: Relax qemu check in uncaught_exception_handler() X-Git-Tag: v20~93^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2142%2Fhead;p=thirdparty%2Fmkosi.git Relax qemu check in uncaught_exception_handler() 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". --- diff --git a/mkosi/run.py b/mkosi/run.py index 6ee9f0304..19f714b8b 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -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.