From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, jsnow@redhat.com, stefanha@redhat.com,
mst@redhat.com
Subject: [Qemu-devel] [PATCH v2 02/30] libqtest: add QTEST_LOG for debugging qtest testcases
Date: Mon, 4 Aug 2014 17:11:03 -0400 [thread overview]
Message-ID: <1407186691-16103-3-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1407186691-16103-1-git-send-email-jsnow@redhat.com>
From: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/libqtest.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 98e8f4b..4a75cd3 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -167,11 +167,12 @@ QTestState *qtest_init(const char *extra_args)
if (s->qemu_pid == 0) {
command = g_strdup_printf("exec %s "
"-qtest unix:%s,nowait "
- "-qtest-log /dev/null "
+ "-qtest-log %s "
"-qmp unix:%s,nowait "
"-machine accel=qtest "
"-display none "
"%s", qemu_binary, socket_path,
+ getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
qmp_socket_path,
extra_args ?: "");
execlp("/bin/sh", "sh", "-c", command, NULL);
@@ -358,6 +359,7 @@ static void qmp_response(JSONMessageParser *parser, QList *tokens)
QDict *qtest_qmp_receive(QTestState *s)
{
QMPResponseParser qmp;
+ bool log = getenv("QTEST_LOG") != NULL;
qmp.response = NULL;
json_message_parser_init(&qmp.parser, qmp_response);
@@ -375,6 +377,9 @@ QDict *qtest_qmp_receive(QTestState *s)
exit(1);
}
+ if (log) {
+ len = write(2, &c, 1);
+ }
json_message_parser_feed(&qmp.parser, &c, 1);
}
json_message_parser_destroy(&qmp.parser);
--
1.9.3
next prev parent reply other threads:[~2014-08-04 21:12 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-04 21:11 [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 01/30] blkdebug: report errors on flush too John Snow
2014-08-04 21:11 ` John Snow [this message]
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 03/30] ide-test: add test for werror=stop John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 04/30] ide: stash aiocb for flushes John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 05/30] ide: simplify reset callbacks John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 06/30] ide: simplify set_inactive callbacks John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 07/30] ide: simplify async_cmd_done callbacks John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 08/30] ide: simplify start_transfer callbacks John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 09/30] ide: wrap start_dma callback John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 10/30] ide: remove wrong setting of BM_STATUS_INT John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 11/30] ide: fold add_status callback into set_inactive John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 12/30] ide: move BM_STATUS bits to pci.[ch] John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 13/30] ide: move retry constants out of BM_STATUS_* namespace John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 14/30] ahci: remove duplicate PORT_IRQ_* constants John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 15/30] ide: stop PIO transfer on errors John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 16/30] ide: make all commands go through cmd_done John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 17/30] ahci: construct PIO Setup FIS for PIO commands John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 18/30] q35: Enable the ioapic device to be seen by qtest John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 19/30] qtest: Adding qtest_memset and qmemset John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 20/30] libqos: Correct memory leak John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 21/30] libqtest: Correct small " John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 22/30] libqos: Fixes a " John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 23/30] libqos: allow qpci_iomap to return BAR mapping size John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 24/30] qtest/ide: Fix small memory leak John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 25/30] ahci: Adding basic functionality qtest John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 26/30] ahci: Add test_pci_spec to ahci-test John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 27/30] ahci: add test_pci_enable " John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 28/30] ahci: Add test_hba_spec " John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 29/30] ahci: Add test_hba_enable " John Snow
2014-08-04 21:11 ` [Qemu-devel] [PATCH v2 30/30] ahci: Add test_identify case " John Snow
2014-08-06 9:43 ` [Qemu-devel] [PATCH v2 00/30] AHCI test suite framework Stefan Hajnoczi
2014-08-06 11:30 ` Markus Armbruster
2014-08-06 16:50 ` John Snow
2014-08-07 6:01 ` Markus Armbruster
2014-08-07 9:26 ` Stefan Hajnoczi
2014-08-11 16:14 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407186691-16103-3-git-send-email-jsnow@redhat.com \
--to=jsnow@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).