提交 8a745f2a 编写于 作者: M Michael Mueller 提交者: Stefan Hajnoczi

tracing: start trace processing thread in final child process

When running with trace backend e.g. "simple" the writer thread needs to be
implemented in the same process context as the trace points that will be
processed. Under libvirtd control, qemu gets first started in daemonized
mode to privide its capabilities. Creating the writer thread in the initial
process context then leads to a dead lock because the thread gets termined
together with the initial parent. (-daemonize)
Signed-off-by: NMichael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
[minor whitespace fixes]
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 0169c511
......@@ -3879,8 +3879,10 @@ int main(int argc, char **argv, char **envp)
qemu_set_log(mask);
}
if (!trace_backend_init(trace_events, trace_file)) {
exit(1);
if (!is_daemonized()) {
if (!trace_backend_init(trace_events, trace_file)) {
exit(1);
}
}
/* If no data_dir is specified then try to find it relative to the
......@@ -4379,6 +4381,12 @@ int main(int argc, char **argv, char **envp)
os_setup_post();
if (is_daemonized()) {
if (!trace_backend_init(trace_events, trace_file)) {
exit(1);
}
}
main_loop();
bdrv_close_all();
pause_all_vcpus();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册