From e9e0bb2af2248eabafb54402e3127f9f8a8690f5 Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Fri, 17 Jun 2016 17:44:10 +0300 Subject: trace: move qemu_trace_opts to trace/control.c The patch also creates trace_opt_parse() helper in trace/control.c to reuse this code in next patches for qemu-nbd and qemu-io. The patch also makes trace_init_events() static, as this call is not used outside the module anymore. Signed-off-by: Denis V. Lunev Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Message-id: 1466174654-30130-4-git-send-email-den@openvz.org CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- vl.c | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 4c1f9aee1f..90cf638121 100644 --- a/vl.c +++ b/vl.c @@ -262,26 +262,6 @@ static QemuOptsList qemu_sandbox_opts = { }, }; -static QemuOptsList qemu_trace_opts = { - .name = "trace", - .implied_opt_name = "enable", - .head = QTAILQ_HEAD_INITIALIZER(qemu_trace_opts.head), - .desc = { - { - .name = "enable", - .type = QEMU_OPT_STRING, - }, - { - .name = "events", - .type = QEMU_OPT_STRING, - },{ - .name = "file", - .type = QEMU_OPT_STRING, - }, - { /* end of list */ } - }, -}; - static QemuOptsList qemu_option_rom_opts = { .name = "option-rom", .implied_opt_name = "romfile", @@ -3864,23 +3844,9 @@ int main(int argc, char **argv, char **envp) xen_mode = XEN_ATTACH; break; case QEMU_OPTION_trace: - { - 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")); - } - trace_init_events(qemu_opt_get(opts, "events")); - if (trace_file) { - g_free(trace_file); - } - trace_file = g_strdup(qemu_opt_get(opts, "file")); - qemu_opts_del(opts); + g_free(trace_file); + trace_file = trace_opt_parse(optarg); break; - } case QEMU_OPTION_readconfig: { int ret = qemu_read_config_file(optarg); -- cgit v1.2.3