From patchwork Wed May 4 10:59:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 67112 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp111082qge; Wed, 4 May 2016 04:00:47 -0700 (PDT) X-Received: by 10.28.59.133 with SMTP id i127mr31002167wma.24.1462359647528; Wed, 04 May 2016 04:00:47 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l127si4257232wmg.108.2016.05.04.04.00.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 04 May 2016 04:00:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axuXe-00050D-9O for patch@linaro.org; Wed, 04 May 2016 07:00:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axuX7-0004PL-C1 for qemu-devel@nongnu.org; Wed, 04 May 2016 07:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axuWv-0002NT-ST for qemu-devel@nongnu.org; Wed, 04 May 2016 06:59:51 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:38118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axuWu-0002Hv-Jn for qemu-devel@nongnu.org; Wed, 04 May 2016 06:59:45 -0400 Received: by mail-wm0-x234.google.com with SMTP id g17so86855296wme.1 for ; Wed, 04 May 2016 03:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zNyloz4kvGawpT270ceQjWv+75Ej+mKTTfx0sONkXJo=; b=OKz6fReoztNOEL8+nuUonvWmJ92hBTJJ5MLu7GCjpIuY0+wYXnDso1j1fanUTuOQAQ AjvFL9Ay44SuRSFc8IChCWdC3UZQX0jOiAxvMjlP06whQOO0cUs4zXs8HT5NBUQsISp7 Mv9emCB6Shl8A07VEpqybaacwrekHXCnlcQYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zNyloz4kvGawpT270ceQjWv+75Ej+mKTTfx0sONkXJo=; b=gF1zc0PpUwU9/zo3llu39HD2S3u9dnG0GDU4m0OkJTPsTTqfnMENochmzZXfP4OMpV LmWht+xfPOD9yqIIL/zJGxPd5+SIEHg9/+thvRfkny/SoxrWZIRlPvUORwO5dtmHz+tq cC36sq9f0TizLOVagKKxaFofLGRRfDGjxMr+PjPHZwtJGJnFtcl55FWPxJZO1PCrOh3x 8JPRi+p0MDDlyhqVwRnP//3mECfwGczS/99K9aj2JE+3K3PuomvDgmH8GuW1DWxatAbF okk6R5b4Z4RMnxcZEFUTT6aGaf9MYCbSGOmyj3RQsgpkqgp/pYCjA26+qoL2W53mK1t5 2jlQ== X-Gm-Message-State: AOPr4FXH5V6ifhN1Yar57MSS2HjFAbBixsGAzNdCKctJ+6uFyW/HCpoL4+Y7Ekbb4GLzCdZb X-Received: by 10.28.169.69 with SMTP id s66mr8340682wme.83.1462359562382; Wed, 04 May 2016 03:59:22 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u187sm4283589wmu.21.2016.05.04.03.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 May 2016 03:59:20 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 158363E02EF; Wed, 4 May 2016 11:59:32 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 4 May 2016 11:59:22 +0100 Message-Id: <1462359562-22538-1-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::234 Subject: [Qemu-devel] [PATCH] libqtest: dump child invocation when QTEST_LOG set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.7.4 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); }