diff options
author | Michael Mueller <mimu@linux.vnet.ibm.com> | 2013-09-23 16:36:54 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-01-27 15:49:39 +0100 |
commit | 8a745f2a9296ad2cf6bda33534ed298f2625a4ad (patch) | |
tree | 3fc2117f44d8850de4add13e73173da0ea918224 /vl.c | |
parent | 0169c511554cb0014a00290b0d3d26c31a49818f (diff) |
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: Michael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[minor whitespace fixes]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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(); |