qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 27/39] util/log: Introduce qemu_set_log_filename_flags


From: Richard Henderson
Subject: Re: [PATCH v2 27/39] util/log: Introduce qemu_set_log_filename_flags
Date: Thu, 14 Apr 2022 10:32:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 4/14/22 07:56, Alex Bennée wrote:
  #ifdef CONFIG_TRACE_LOG
-    qemu_loglevel |= LOG_TRACE;
+    log_flags |= LOG_TRACE;
  #endif
+    qemu_loglevel = log_flags;
+

This looked weird - so should we consider a qatomic_set here to avoid an
inconsistent set of flags being read non-atomically elsewhere?

I suppose we could do, as a separate change, since this has not been considered before. But I don't believe in tears to aligned 'int' on any qemu host.

+        logfile = g_new0(QemuLogFile, 1);
+        logfile->fd = fd;
          qatomic_rcu_set(&qemu_logfile, logfile);

I was also pondering if flags should be part of the QemuLogFile
structure so it's consistent with each opened file. However I see it
gets repurposed just for clean-up later...

I actually had this at one point in development. But yes, there's no point in it for just the release.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]