Received: from eggs.gnu.org ([2001:4830:134:3::10]:44776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9Ih-00005t-HE for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bX9Ib-00026n-OU for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:50:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bX9Ib-00026V-HB for qemu-devel@nongnu.org; Tue, 09 Aug 2016 11:50:37 -0400 References: <1462359562-22538-1-git-send-email-alex.bennee@linaro.org> <87a8gmc8b8.fsf@linaro.org> From: John Snow Message-ID: Date: Tue, 9 Aug 2016 11:50:36 -0400 MIME-Version: 1.0 In-Reply-To: <87a8gmc8b8.fsf@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?Q?Alex_Benn=c3=a9e?= , qemu-devel@nongnu.org On 08/09/2016 10:42 AM, Alex Benn=C3=A9e wrote: > > Alex Benn=C3=A9e writes: > >> The QTEST_LOG environment is used for debugging qtest interactions wit= h >> a child process. When it is defined we now also dump the invocation li= ne >> to stderr to make it easier for people to see how QEMU was invoked. >> >> Signed-off-by: Alex Benn=C3=A9e >> 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 =3D fork(); >> if (s->qemu_pid =3D=3D 0) { >> + bool qtest_log =3D getenv("QTEST_LOG"); >> setenv("QEMU_AUDIO_DRV", "none", true); >> command =3D g_strdup_printf("exec %s " >> "-qtest unix:%s,nowait " >> @@ -179,9 +180,12 @@ QTestState *qtest_init(const char *extra_args) >> "-machine accel=3Dqtest " >> "-display none " >> "%s", qemu_binary, socket_path, >> - getenv("QTEST_LOG") ? "/dev/fd/2" := "/dev/null", >> + qtest_log ? "/dev/fd/2" : "/dev/nul= l", >> 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=C3=A9e > Reviewed-By: John Snow I guess nobody owns qtest specifically... Paolo? Peter? --js