[Virtio-fs] [PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

Stefan Hajnoczi stefanha at redhat.com
Wed Aug 24 17:41:29 UTC 2022


On Thu, Aug 18, 2022 at 02:46:19PM -0400, Yusuke Okada wrote:
> From: Yusuke Okada <okada.yusuke at 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 at jp.fujitsu.com>
> ---
>  tools/virtiofsd/passthrough_ll.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Thanks, applied to my block tree for QEMU 7.2:
https://gitlab.com/stefanha/qemu/commits/block

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virtio-fs/attachments/20220824/510191ff/attachment.sig>


More information about the Virtio-fs mailing list