trace/control: Fix -Wunused-but-set-global warning with clang 23+
../trace/control.c:41:13: error: variable 'init_trace_on_startup' set but not used [-Werror,-Wunused-but-set-global] 41 | static bool init_trace_on_startup; | ^ 1 error generated. Signed-off-by: Tom Stellard <tstellar@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20260617224145.1419961-1-tstellar@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tom Stellard committed
Jun 17, 2026 at 15:41 UTC
c0f8130a31759f75335466074f80dba6de2b1a16
1 file changed
+4
trace/control.c
+4
@@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;
38
static size_t nevent_groups;
39
static uint32_t next_id;
40
static uint32_t next_vcpu_id;
41
+#ifdef CONFIG_TRACE_SIMPLE
42
static bool init_trace_on_startup;
43
+#endif
44
static char *trace_opts_file;
45
46
QemuOptsList qemu_trace_opts = {
@@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)
297
trace_enable_events(qemu_opt_get(opts, "enable"));
298
}
299
trace_init_events(qemu_opt_get(opts, "events"));
300
+#ifdef CONFIG_TRACE_SIMPLE
301
init_trace_on_startup = true;
302
+#endif
303
g_free(trace_opts_file);
304
trace_opts_file = g_strdup(qemu_opt_get(opts, "file"));
305
qemu_opts_del(opts);