From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: [Qemu-devel] [PULL 3/3] qtest: log QEMU command line
Date: Tue, 20 Nov 2018 11:52:23 +0100 [thread overview]
Message-ID: <1542711143-1946-4-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1542711143-1946-1-git-send-email-thuth@redhat.com>
From: Paolo Bonzini <pbonzini@redhat.com>
Record the command line that was used to start QEMU. This can be
useful for debugging.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
[thuth: removed trailing \n from the message string]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/libqtest.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 44ce118..75e07e1 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -215,24 +215,28 @@ QTestState *qtest_init_without_qmp_handshake(bool use_oob,
qtest_add_abrt_handler(kill_qemu_hook_func, s);
+ command = g_strdup_printf("exec %s "
+ "-qtest unix:%s,nowait "
+ "-qtest-log %s "
+ "-chardev socket,path=%s,nowait,id=char0 "
+ "-mon chardev=char0,mode=control%s "
+ "-machine accel=qtest "
+ "-display none "
+ "%s", qemu_binary, socket_path,
+ getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
+ qmp_socket_path, use_oob ? ",x-oob=on" : "",
+ extra_args ?: "");
+
+ g_test_message("starting QEMU: %s", command);
+
s->qemu_pid = fork();
if (s->qemu_pid == 0) {
setenv("QEMU_AUDIO_DRV", "none", true);
- command = g_strdup_printf("exec %s "
- "-qtest unix:%s,nowait "
- "-qtest-log %s "
- "-chardev socket,path=%s,nowait,id=char0 "
- "-mon chardev=char0,mode=control%s "
- "-machine accel=qtest "
- "-display none "
- "%s", qemu_binary, socket_path,
- getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
- qmp_socket_path, use_oob ? ",x-oob=on" : "",
- extra_args ?: "");
execlp("/bin/sh", "sh", "-c", command, NULL);
exit(1);
}
+ g_free(command);
s->fd = socket_accept(sock);
if (s->fd >= 0) {
s->qmp_fd = socket_accept(qmpsock);
--
1.8.3.1
next prev parent reply other threads:[~2018-11-20 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 10:52 [Qemu-devel] [PULL 0/3] qtest patches Thomas Huth
2018-11-20 10:52 ` [Qemu-devel] [PULL 1/3] tests: add qmp/missing-any-arg test Thomas Huth
2018-11-20 10:52 ` [Qemu-devel] [PULL 2/3] tests/ide: Free pcibus when finishing a test Thomas Huth
2018-11-20 10:52 ` Thomas Huth [this message]
2018-11-20 11:36 ` [Qemu-devel] [PULL 0/3] qtest patches Peter Maydell
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=1542711143-1946-4-git-send-email-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=armbru@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).