qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG set
Date: Tue, 09 Aug 2016 15:42:51 +0100
User-agent: mu4e 0.9.17; emacs 25.1.4

Alex Bennée <address@hidden> 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 <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
>  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 via email to

[Prev in Thread] Current Thread [Next in Thread]