qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/1] Block patches
@ 2022-09-22 17:14 Stefan Hajnoczi
  2022-09-22 17:14 ` [PULL 1/1] virtiofsd: use g_date_time_get_microsecond to get subsecond Stefan Hajnoczi
  2022-09-27 15:04 ` [PULL 0/1] Block patches Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-09-22 17:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, qemu-block, Dr. David Alan Gilbert, virtio-fs

The following changes since commit 6338c30111d596d955e6bc933a82184a0b910c43:

  Merge tag 'm68k-for-7.2-pull-request' of https://github.com/vivier/qemu-m68k into staging (2022-09-21 13:12:36 -0400)

are available in the Git repository at:

  https://gitlab.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to f16d15c9276bd8f501f861c39cbd4adc812d0c1d:

  virtiofsd: use g_date_time_get_microsecond to get subsecond (2022-09-22 13:13:47 -0400)

----------------------------------------------------------------
Pull request

----------------------------------------------------------------

Yusuke Okada (1):
  virtiofsd: use g_date_time_get_microsecond to get subsecond

 tools/virtiofsd/passthrough_ll.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.37.3



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

* [PULL 1/1] virtiofsd: use g_date_time_get_microsecond to get subsecond
  2022-09-22 17:14 [PULL 0/1] Block patches Stefan Hajnoczi
@ 2022-09-22 17:14 ` Stefan Hajnoczi
  2022-09-27 15:04 ` [PULL 0/1] Block patches Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-09-22 17:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, qemu-block, Dr. David Alan Gilbert, virtio-fs,
	Yusuke Okada

From: Yusuke Okada <okada.yusuke@jp.fujitsu.com>

The "%f" specifier in g_date_time_format() is only available in glib
2.65.2 or later. If combined with older glib, the function returns null
and the timestamp displayed as "(null)".

For backward compatibility, g_date_time_get_microsecond should be used
to retrieve subsecond.

In this patch the g_date_time_format() leaves subsecond field as "%06d"
and let next snprintf to format with g_date_time_get_microsecond.

Signed-off-by: Yusuke Okada <okada.yusuke@jp.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 20220818184618.2205172-1-yokada.996@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tools/virtiofsd/passthrough_ll.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 371a7bead6..20f0f41f99 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -4185,6 +4185,7 @@ static void setup_nofile_rlimit(unsigned long rlimit_nofile)
 static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
 {
     g_autofree char *localfmt = NULL;
+    char buf[64];
 
     if (current_log_level < level) {
         return;
@@ -4197,9 +4198,11 @@ static void log_func(enum fuse_log_level level, const char *fmt, va_list ap)
                                        fmt);
         } else {
             g_autoptr(GDateTime) now = g_date_time_new_now_utc();
-            g_autofree char *nowstr = g_date_time_format(now, "%Y-%m-%d %H:%M:%S.%f%z");
+            g_autofree char *nowstr = g_date_time_format(now,
+                                       "%Y-%m-%d %H:%M:%S.%%06d%z");
+            snprintf(buf, 64, nowstr, g_date_time_get_microsecond(now));
             localfmt = g_strdup_printf("[%s] [ID: %08ld] %s",
-                                       nowstr, syscall(__NR_gettid), fmt);
+                                       buf, syscall(__NR_gettid), fmt);
         }
         fmt = localfmt;
     }
-- 
2.37.3



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

* Re: [PULL 0/1] Block patches
  2022-09-22 17:14 [PULL 0/1] Block patches Stefan Hajnoczi
  2022-09-22 17:14 ` [PULL 1/1] virtiofsd: use g_date_time_get_microsecond to get subsecond Stefan Hajnoczi
@ 2022-09-27 15:04 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2022-09-27 15:04 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: qemu-devel, Stefan Hajnoczi, qemu-block, Dr. David Alan Gilbert,
	virtio-fs

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

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.

[-- 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:[~2022-09-27 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 17:14 [PULL 0/1] Block patches Stefan Hajnoczi
2022-09-22 17:14 ` [PULL 1/1] virtiofsd: use g_date_time_get_microsecond to get subsecond Stefan Hajnoczi
2022-09-27 15:04 ` [PULL 0/1] Block patches Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).