aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-11-15 13:29:30 +0100
committerThomas Huth <thuth@redhat.com>2018-11-20 10:49:12 +0100
commitced09f9b07e425690d3bfe524cf93c4dbf4b26bc (patch)
tree9254f16b083f61a98db4fc681262649837ed33fd /tests
parent3b6b0a8ae7b437256aba3b44643a7a608d54b916 (diff)
qtest: log QEMU command line
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/libqtest.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 44ce118cfc..75e07e16e7 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);