diff --git a/vl.c b/vl.c index 7f4fe0d5df59b50f0635ffcb7fb222441035890d..63f4d5585c4b9580e65fbc2b7d2065937c1e29ea 100644 --- a/vl.c +++ b/vl.c @@ -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();