qemu/trace
Paolo Bonzini 9f45a64109 trace: fix "-trace file=..."
Because trace_opt_parse always deletes the options it has parsed,
trace_init_file's call to qemu_find_opts_singleton always
creates an empty -trace option group.  Therefore, the subsequent
qemu_opt_get(opts, "file") always returns NULL.

To fix this, save the last "-trace file=..." option in a global
variable and use it later in trace_init_file.

This is similar to what was done before commit 92eecfff32 ("trace:
remove argument from trace_init_file", 2020-11-11), except contained
within trace/control.c and without memory leaks.

Fixes: 92eecfff32 ("trace: remove argument from trace_init_file", 2020-11-11)
Cc: stefanha@redhat.com
Reported-by: armbru@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210209145759.141231-2-pbonzini@redhat.com>
2021-03-06 11:42:57 +01:00
..
control-internal.h
control-target.c trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
control-vcpu.h
control.c trace: fix "-trace file=..." 2021-03-06 11:42:57 +01:00
control.h trace: Send "-d trace:help" output to stdout 2021-01-04 14:24:40 +00:00
event-internal.h
ftrace.c
ftrace.h
mem-internal.h trace: Remove trace_mem_build_info_no_se_[bl]e 2020-01-15 15:13:09 -10:00
mem.h
meson.build trace: add meson custom_target() depend_files for tracetool 2021-02-01 10:50:55 +00:00
qmp.c qapi: Use QAPI_LIST_PREPEND() where possible 2020-12-19 10:20:14 +01:00
simple.c trace/simple: Fix unauthorized enable 2020-06-24 11:21:00 +01:00
simple.h trace/simple: Fix unauthorized enable 2020-06-24 11:21:00 +01:00