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>
This commit is contained in:
parent
3b6b0a8ae7
commit
ced09f9b07
|
@ -215,9 +215,6 @@ QTestState *qtest_init_without_qmp_handshake(bool use_oob,
|
||||||
|
|
||||||
qtest_add_abrt_handler(kill_qemu_hook_func, s);
|
qtest_add_abrt_handler(kill_qemu_hook_func, s);
|
||||||
|
|
||||||
s->qemu_pid = fork();
|
|
||||||
if (s->qemu_pid == 0) {
|
|
||||||
setenv("QEMU_AUDIO_DRV", "none", true);
|
|
||||||
command = g_strdup_printf("exec %s "
|
command = g_strdup_printf("exec %s "
|
||||||
"-qtest unix:%s,nowait "
|
"-qtest unix:%s,nowait "
|
||||||
"-qtest-log %s "
|
"-qtest-log %s "
|
||||||
|
@ -229,10 +226,17 @@ QTestState *qtest_init_without_qmp_handshake(bool use_oob,
|
||||||
getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
|
getenv("QTEST_LOG") ? "/dev/fd/2" : "/dev/null",
|
||||||
qmp_socket_path, use_oob ? ",x-oob=on" : "",
|
qmp_socket_path, use_oob ? ",x-oob=on" : "",
|
||||||
extra_args ?: "");
|
extra_args ?: "");
|
||||||
|
|
||||||
|
g_test_message("starting QEMU: %s", command);
|
||||||
|
|
||||||
|
s->qemu_pid = fork();
|
||||||
|
if (s->qemu_pid == 0) {
|
||||||
|
setenv("QEMU_AUDIO_DRV", "none", true);
|
||||||
execlp("/bin/sh", "sh", "-c", command, NULL);
|
execlp("/bin/sh", "sh", "-c", command, NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free(command);
|
||||||
s->fd = socket_accept(sock);
|
s->fd = socket_accept(sock);
|
||||||
if (s->fd >= 0) {
|
if (s->fd >= 0) {
|
||||||
s->qmp_fd = socket_accept(qmpsock);
|
s->qmp_fd = socket_accept(qmpsock);
|
||||||
|
|
Loading…
Reference in a new issue