qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Gustavo Romero <gustavo.romero@linaro.org>,
	qemu-devel@nongnu.org, alex.bennee@linaro.org,
	berrange@redhat.com
Cc: qemu-arm@nongnu.org, 1844144@gmail.com
Subject: Re: [PATCH v2 3/5] tests/guest-debug: Add quiet option to run-tests.py
Date: Mon, 8 Sep 2025 11:12:40 +0200	[thread overview]
Message-ID: <e43d5fa3-6687-4837-b99c-5d95f0e563f1@redhat.com> (raw)
In-Reply-To: <20250904154640.52687-4-gustavo.romero@linaro.org>

On 04/09/2025 17.46, Gustavo Romero wrote:
> Add a --quiet option to run-tests.py so it can run without printing any
> messages to the stdout.
> 
> Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
> ---
>   tests/guest-debug/run-test.py | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py
> index e051e8947c..cf8b37b8b8 100755
> --- a/tests/guest-debug/run-test.py
> +++ b/tests/guest-debug/run-test.py
> @@ -39,15 +39,17 @@ def get_args():
>       parser.add_argument("--stderr", help="A file to redirect stderr to")
>       parser.add_argument("--no-suspend", action="store_true",
>                           help="Ask the binary to not wait for GDB connection")
> +    parser.add_argument("--quiet", action="store_true", default=False,
> +                        help="Don't print any messages to stdout")
>   
>       return parser.parse_args()
>   
>   
> -def log(output, msg):
> +def log(output, msg, quiet):
>       if output:
>           output.write(msg + "\n")
>           output.flush()
> -    else:
> +    elif not quiet:
>           print(msg)
>   
>   
> @@ -91,7 +93,7 @@ def log(output, msg):
>               cmd = f'{args.qemu} {args.qargs} -g {socket_name}{suspend}' \
>                   f' {args.binary}'
>   
> -        log(output, "QEMU CMD: %s" % (cmd))
> +        log(output, "QEMU CMD: %s" % (cmd), args.quiet)
>           inferior = subprocess.Popen(shlex.split(cmd))
>   
>       # Now launch gdb with our test and collect the result.
> @@ -117,7 +119,7 @@ def log(output, msg):
>   
>   
>       sleep(1)
> -    log(output, "GDB CMD: %s" % (gdb_cmd))
> +    log(output, "GDB CMD: %s" % (gdb_cmd), args.quiet)
>   
>       gdb_env = dict(os.environ)
>       gdb_pythonpath = gdb_env.get("PYTHONPATH", "").split(os.pathsep)

I can see two more calls to log() in that script, don't you need to change 
these spots, too:

$ grep log tests/guest-debug/run-test.py
def log(output, msg):
     log(output, "QEMU CMD: %s" % (cmd))
     log(output, "GDB CMD: %s" % (gdb_cmd))
         log(output, "GDB crashed? (%d, %d) SKIPPING" % (result, result - 128))
         log(output, "GDB never connected? Killed guest")

?

Maybe you could declare the new parameter with quiet=False by default, so 
that you don't have to worry?

  Thomas



  parent reply	other threads:[~2025-09-08  9:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 15:46 [PATCH v2 0/5] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-04 15:46 ` [PATCH v2 1/5] tests/guest-debug: Make QEMU optional in run-test.py Gustavo Romero
2025-09-05  7:22   ` Alex Bennée
2025-09-08  9:02   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 2/5] tests/guest-debug: Format comments Gustavo Romero
2025-09-05  7:22   ` Alex Bennée
2025-09-08  9:03   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 3/5] tests/guest-debug: Add quiet option to run-tests.py Gustavo Romero
2025-09-05  7:21   ` Alex Bennée
2025-09-08  9:12   ` Thomas Huth [this message]
2025-09-04 15:46 ` [PATCH v2 4/5] tests/functional: Support tests that require a runner Gustavo Romero
2025-09-08  9:21   ` Thomas Huth
2025-09-04 15:46 ` [PATCH v2 5/5] tests/functional: Adapt reverse_debugging to run w/o Avocado Gustavo Romero
2025-09-05  7:21   ` Alex Bennée
2025-09-08  9:16   ` Daniel P. Berrangé
2025-09-11 23:50     ` Gustavo Romero
2025-09-08 11:49 ` [PATCH v2 0/5] " Daniel P. Berrangé
2025-09-11 23:51   ` Gustavo Romero
2025-09-12 14:49     ` Daniel P. Berrangé
2025-09-12 16:04       ` Alex Bennée
2025-09-12 16:27         ` Daniel P. Berrangé
2025-09-12 16:50           ` Peter Maydell
2025-09-15 12:49           ` Thomas Huth
2025-09-15 22:11             ` Gustavo Romero
2025-09-15  8:29 ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e43d5fa3-6687-4837-b99c-5d95f0e563f1@redhat.com \
    --to=thuth@redhat.com \
    --cc=1844144@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=gustavo.romero@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).