On 8/20/25 06:27, Daniel P. Berrangé wrote:
  void qemu_log(const char *fmt, ...)
  {
      FILE *f;
-    g_autofree const char *timestr = NULL;
-
      /*
-     * Prepare the timestamp*outside* the logging
-     * lock so it better reflects when the message
-     * was emitted if we are delayed acquiring the
-     * mutex
+     * Prepare the context*outside* the logging
+     * lock so any timestamp better reflects when
+     * the message was emitted if we are delayed
+     * acquiring the mutex
       */
-    if (message_with_timestamp) {
-        g_autoptr(GDateTime) dt = g_date_time_new_now_utc();
-        timestr = g_date_time_format_iso8601(dt);
-    }

Something that really ought to be handled better is that we currently use qemu_log to print pieces of a larger message. E.g. looping over the general registers to print the whole cpu state.

(1) We don't want timestamps in the middle, and
(2) we don't want unnecessary memory allocation in the middle.


r~

Reply via email to