@@ -251,6 +251,13 @@ extern QemuOptsList qemu_trace_opts;
*/
void trace_opt_parse(const char *optarg);
+/**
+ * Same as trace_opt_parse, but accept QemuOpts instead of options string.
+ *
+ * Releases @opts at the end.
+ */
+void trace_opt_parse_opts(QemuOpts *opts);
+
/**
* trace_get_vcpu_event_count:
*
@@ -313,13 +313,8 @@ bool trace_init_backends(void)
return true;
}
-void trace_opt_parse(const char *optarg)
+void trace_opt_parse_opts(QemuOpts *opts)
{
- QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"),
- optarg, true);
- if (!opts) {
- exit(1);
- }
if (qemu_opt_get(opts, "enable")) {
trace_enable_events(qemu_opt_get(opts, "enable"));
}
@@ -330,6 +325,17 @@ void trace_opt_parse(const char *optarg)
qemu_opts_del(opts);
}
+void trace_opt_parse(const char *optarg)
+{
+ QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"),
+ optarg, true);
+ if (!opts) {
+ exit(1);
+ }
+
+ trace_opt_parse_opts(opts);
+}
+
uint32_t trace_get_vcpu_event_count(void)
{
return next_vcpu_id;
Add a function same as trace_opt_parse, but parameter is QemuOpts. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- trace/control.h | 7 +++++++ trace/control.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-)