All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace/control: Fix -Wunused-but-set-global warning with clang 23+
@ 2026-06-17 22:41 Tom Stellard
  2026-06-18  7:55 ` Daniel P. Berrangé
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Stellard @ 2026-06-17 22:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: Tom Stellard

../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>
---
 trace/control.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/trace/control.c b/trace/control.c
index 1c8c50064a..49f0a4c5cd 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;
 static size_t nevent_groups;
 static uint32_t next_id;
 static uint32_t next_vcpu_id;
+#ifdef CONFIG_TRACE_SIMPLE
 static bool init_trace_on_startup;
+#endif
 static char *trace_opts_file;
 
 QemuOptsList qemu_trace_opts = {
@@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)
         trace_enable_events(qemu_opt_get(opts, "enable"));
     }
     trace_init_events(qemu_opt_get(opts, "events"));
+#ifdef CONFIG_TRACE_SIMPLE
     init_trace_on_startup = true;
+#endif
     g_free(trace_opts_file);
     trace_opts_file = g_strdup(qemu_opt_get(opts, "file"));
     qemu_opts_del(opts);
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace/control: Fix -Wunused-but-set-global warning with clang 23+
  2026-06-17 22:41 [PATCH] trace/control: Fix -Wunused-but-set-global warning with clang 23+ Tom Stellard
@ 2026-06-18  7:55 ` Daniel P. Berrangé
  2026-06-18 15:11   ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrangé @ 2026-06-18  7:55 UTC (permalink / raw)
  To: Tom Stellard, Stefan Hajnoczi; +Cc: qemu-devel

CC trace maintainer.

On Wed, Jun 17, 2026 at 03:41:45PM -0700, Tom Stellard wrote:
> ../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>
> ---
>  trace/control.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

> 
> diff --git a/trace/control.c b/trace/control.c
> index 1c8c50064a..49f0a4c5cd 100644
> --- a/trace/control.c
> +++ b/trace/control.c
> @@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;
>  static size_t nevent_groups;
>  static uint32_t next_id;
>  static uint32_t next_vcpu_id;
> +#ifdef CONFIG_TRACE_SIMPLE
>  static bool init_trace_on_startup;
> +#endif
>  static char *trace_opts_file;
>  
>  QemuOptsList qemu_trace_opts = {
> @@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)
>          trace_enable_events(qemu_opt_get(opts, "enable"));
>      }
>      trace_init_events(qemu_opt_get(opts, "events"));
> +#ifdef CONFIG_TRACE_SIMPLE
>      init_trace_on_startup = true;
> +#endif
>      g_free(trace_opts_file);
>      trace_opts_file = g_strdup(qemu_opt_get(opts, "file"));
>      qemu_opts_del(opts);
> -- 
> 2.51.0
> 
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace/control: Fix -Wunused-but-set-global warning with clang 23+
  2026-06-18  7:55 ` Daniel P. Berrangé
@ 2026-06-18 15:11   ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2026-06-18 15:11 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: Tom Stellard, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

On Thu, Jun 18, 2026 at 08:55:07AM +0100, Daniel P. Berrangé wrote:
> CC trace maintainer.
> 
> On Wed, Jun 17, 2026 at 03:41:45PM -0700, Tom Stellard wrote:
> > ../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>
> > ---
> >  trace/control.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> > 
> > diff --git a/trace/control.c b/trace/control.c
> > index 1c8c50064a..49f0a4c5cd 100644
> > --- a/trace/control.c
> > +++ b/trace/control.c
> > @@ -38,7 +38,9 @@ static TraceEventGroup *event_groups;
> >  static size_t nevent_groups;
> >  static uint32_t next_id;
> >  static uint32_t next_vcpu_id;
> > +#ifdef CONFIG_TRACE_SIMPLE
> >  static bool init_trace_on_startup;
> > +#endif
> >  static char *trace_opts_file;
> >  
> >  QemuOptsList qemu_trace_opts = {
> > @@ -295,7 +297,9 @@ void trace_opt_parse(const char *optstr)
> >          trace_enable_events(qemu_opt_get(opts, "enable"));
> >      }
> >      trace_init_events(qemu_opt_get(opts, "events"));
> > +#ifdef CONFIG_TRACE_SIMPLE
> >      init_trace_on_startup = true;
> > +#endif
> >      g_free(trace_opts_file);
> >      trace_opts_file = g_strdup(qemu_opt_get(opts, "file"));
> >      qemu_opts_del(opts);
> > -- 
> > 2.51.0
> > 
> > 
> 
> With regards,
> Daniel
> -- 
> |: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
> |: https://libvirt.org          ~~          https://entangle-photo.org :|
> |: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|
> 

Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-18 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 22:41 [PATCH] trace/control: Fix -Wunused-but-set-global warning with clang 23+ Tom Stellard
2026-06-18  7:55 ` Daniel P. Berrangé
2026-06-18 15:11   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.