From d770f7983f8bd4cd18cb68c6210322780aaa4ac0 Mon Sep 17 00:00:00 2001 From: Elias Masur Date: Sun, 15 Mar 2026 19:30:42 +0100 Subject: [PATCH] tools/qvm-run: translate negative return codes to positive exit codes --- qubesadmin/tools/qvm_run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qubesadmin/tools/qvm_run.py b/qubesadmin/tools/qvm_run.py index 7045a065..c314b96a 100644 --- a/qubesadmin/tools/qvm_run.py +++ b/qubesadmin/tools/qvm_run.py @@ -483,6 +483,9 @@ def main(args=None, app=None): try: for vm, proc in procs: this_retcode = proc.wait() + if this_retcode < 0: + this_retcode = 128 + abs(this_retcode) + if this_retcode and verbose > 0: print_no_color( "{}: command failed with code: {}".format( @@ -491,7 +494,7 @@ def main(args=None, app=None): file=sys.stderr, color=args.color_stderr, ) - retcode = max(retcode, proc.wait()) + retcode = max(retcode, this_retcode) except KeyboardInterrupt: for vm, proc in procs: with contextlib.suppress(ProcessLookupError):