From patchwork Wed Apr 13 13:34:17 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: 8822441 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7E2C8C0553 for ; Wed, 13 Apr 2016 13:34:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D26A7201F5 for ; Wed, 13 Apr 2016 13:34:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6E62201D3 for ; Wed, 13 Apr 2016 13:34:32 +0000 (UTC) Received: from localhost ([::1]:43921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqKwB-0004gx-QQ for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Apr 2016 09:34:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqKw0-0004YO-6e for qemu-devel@nongnu.org; Wed, 13 Apr 2016 09:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqKvx-0006Bw-1T for qemu-devel@nongnu.org; Wed, 13 Apr 2016 09:34:20 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:36715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqKvw-0006BG-KC for qemu-devel@nongnu.org; Wed, 13 Apr 2016 09:34:16 -0400 Received: by mail-wm0-x22b.google.com with SMTP id v188so175077860wme.1 for ; Wed, 13 Apr 2016 06:34:16 -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=bkUOh5jru+Xd92/WL94LzCgXbjU5ZIlYLoHweYPp67A=; b=Lo/WGYqtLBk+HgGKr0I9h0ORXn/9y2Y1BdZ8OCR4b9qOv6KMemiJObZCqguEmlvSoe PNRiD1ycWQXFIX+8qvKkDvSKnZ9ocBiS/pLIbFcKKo0tvVNgXSKFU+bW0/v8FTVjgWCn wRufHE2cbWrYUqpxmY13wNkl5YUkZUFiyDsKg= 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=bkUOh5jru+Xd92/WL94LzCgXbjU5ZIlYLoHweYPp67A=; b=mpYus7H6nYhO5Yhd95IybowU3a/tigp089AUUfF3z5fAHGOO6WDoB9nSCbG84QZC36 2FRnpd7tyCau1R7biHR7UNvjqOoYF7lt0vpd1XypwrV1l5O0+GFRG3ULlDf2hmPdqMU2 XnQjF/lCH8LQJuKiRQ7A6cb4y5L7bhTFAsCqxNs6zKLIDe4JBhJwcY3q8UttSAbi2cyc erO8klb9zQZ1KcuBFVruV5qxE/joMHeR/2fxFtkvamoD1yrSRKo1ckETN/Bo/mw5TpXo 9V0vO9s7LgSdPJ1WWKx1vxsQ1AiUi+LNPahaEL3A2/hxxVbQiWXd3zwy3x24tsx9LKQs Rpqw== X-Gm-Message-State: AD7BkJJcmsDKb/piG5aNAJpqFwcbksEPqziNjuqZYW1YSYPN8QNlteMAb2uikL1kJ8/5CjHj X-Received: by 10.28.127.4 with SMTP id a4mr31973853wmd.76.1460554455504; Wed, 13 Apr 2016 06:34:15 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m134sm1327758wmd.14.2016.04.13.06.34.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Apr 2016 06:34:14 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 159573E02AD; Wed, 13 Apr 2016 14:34:26 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 13 Apr 2016 14:34:17 +0100 Message-Id: <1460554457-18119-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::22b Subject: [Qemu-devel] [RFC] 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?= , armbru@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }