qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG set
Date: Tue, 09 Aug 2016 15:42:51 +0100	[thread overview]
Message-ID: <87a8gmc8b8.fsf@linaro.org> (raw)
In-Reply-To: <1462359562-22538-1-git-send-email-alex.bennee@linaro.org>


Alex Bennée <alex.bennee@linaro.org> writes:

> The QTEST_LOG environment is used for debugging qtest interactions with
> a child process. When it is defined we now also dump the invocation line
> to stderr to make it easier for people to see how QEMU was invoked.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/libqtest.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tests/libqtest.c b/tests/libqtest.c
> index b12a9e4..dd94abf 100644
> --- a/tests/libqtest.c
> +++ b/tests/libqtest.c
> @@ -171,6 +171,7 @@ QTestState *qtest_init(const char *extra_args)
>
>      s->qemu_pid = fork();
>      if (s->qemu_pid == 0) {
> +        bool qtest_log = getenv("QTEST_LOG");
>          setenv("QEMU_AUDIO_DRV", "none", true);
>          command = g_strdup_printf("exec %s "
>                                    "-qtest unix:%s,nowait "
> @@ -179,9 +180,12 @@ QTestState *qtest_init(const char *extra_args)
>                                    "-machine accel=qtest "
>                                    "-display none "
>                                    "%s", qemu_binary, socket_path,
> -                                  getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
> +                                  qtest_log ? "/dev/fd/2" : "/dev/null",
>                                    qmp_socket_path,
>                                    extra_args ?: "");
> +        if (qtest_log) {
> +            fprintf(stderr, "%s\n", command);
> +        }
>          execlp("/bin/sh", "sh", "-c", command, NULL);
>          exit(1);
>      }

Ping?

--
Alex Bennée

  reply	other threads:[~2016-08-09 14:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04 10:59 [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG set Alex Bennée
2016-08-09 14:42 ` Alex Bennée [this message]
2016-08-09 15:50   ` John Snow

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=87a8gmc8b8.fsf@linaro.org \
    --to=alex.bennee@linaro.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).