Commit c9aa98091f for qemu.org

commit c9aa98091fc7cb5cbb6eea97767af44d287f38a7
Author: Richard Henderson <richard.henderson@linaro.org>
Date:   Wed Sep 16 14:56:51 2026 -1000

    tests/guest-debug/run-test: Add --pargs

    Add --pargs=<string> to pass command-line arguments to the user-mode
    program.  Assert when using --pargs with a system mode program.

    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py
index 75e9c92e03..838c1c2697 100755
--- a/tests/guest-debug/run-test.py
+++ b/tests/guest-debug/run-test.py
@@ -24,6 +24,7 @@ def get_args():
     parser.add_argument("--qemu", help="Qemu binary for test",
                         required=True)
     parser.add_argument("--qargs", help="Qemu arguments for test")
+    parser.add_argument("--pargs", help="Program arguments for test")
     parser.add_argument("--binary", help="Binary to debug",
                         required=True)
     parser.add_argument("--test", help="GDB test script")
@@ -81,6 +82,8 @@ def log(output, msg):
             suspend = ' -S'
         cmd = f'{args.qemu} {args.qargs} {args.binary}' \
             f'{suspend} -gdb unix:path={socket_name},server=on'
+        # There is no guest program command-line in system mode.
+        assert not args.pargs
     else:
         if args.no_suspend:
             suspend = ',suspend=n'
@@ -88,6 +91,8 @@ def log(output, msg):
             suspend = ''
         cmd = f'{args.qemu} {args.qargs} -g {socket_name}{suspend}' \
             f' {args.binary}'
+        if args.pargs:
+            cmd += f' {args.pargs}'

     log(output, "QEMU CMD: %s" % (cmd))
     inferior = subprocess.Popen(shlex.split(cmd))