From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX8F1-0008H6-DN for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX8Ev-0000Hd-EP for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:42:50 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX8Eu-0000HT-Pf for qemu-devel@nongnu.org; Tue, 09 Aug 2016 10:42:45 -0400 Received: by mail-wm0-x232.google.com with SMTP id i5so40121697wmg.0 for ; Tue, 09 Aug 2016 07:42:44 -0700 (PDT) References: <1462359562-22538-1-git-send-email-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1462359562-22538-1-git-send-email-alex.bennee@linaro.org> Date: Tue, 09 Aug 2016 15:42:51 +0100 Message-ID: <87a8gmc8b8.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alex =?utf-8?Q?Benn=C3=A9e?= Alex Bennée 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 > Reviewed-by: Stefan Hajnoczi > --- > 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