All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gonglei <arei.gonglei@huawei.com>
To: Eric Blake <eblake@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"Herongguang (Stephen)" <herongguang.he@huawei.com>
Subject: Re: [Qemu-devel] [RFC] Can we convert UTC time to local time in Qemu
Date: Thu, 21 May 2015 10:10:31 +0800	[thread overview]
Message-ID: <555D3E97.4000806@huawei.com> (raw)
In-Reply-To: <555C9DA1.7060204@redhat.com>

On 2015/5/20 22:43, Eric Blake wrote:
> On 05/20/2015 12:29 AM, Gonglei (Arei) wrote:
>> Hi,
>>
>> At present, Qemu use g_time_val_to_iso8601() to get the UTC added to error_report()
>> (commit 5e2ac5191), TBH this way is very simply, we just need invoke standard glib functions to
>> complete the job. 
> 
> local time is ambiguous (daylight savings, and even consider what
> happens when you physically relocate your machine to a different time
> zone).  UTC is better.
> 
Actually this is a scenario that happen unlikely. :(
>>
>> But in the cloud computing and data center scenarios, there are many
>> Other open source components, such as kernel, libvirt, openstack which are all using local time
>> to record the message logs, only Qemu is using the UTC time. When we want to find a error
>> message of Qemu, we should convert the UTC time to local time manually, and unfortunately
>> different countries have different local time, what a trouble thing the converting is.
>>
>> So, my question is: Can we convert the UTC time to local time in Qemu? 
> 
> Actually, libvirt uses UTC on purpose, not only because it is
> unambiguous, but because it prints timestamps even in situations where
> it must be async-signal safe, and there is no async-signal-safe way to
> determine the offset required to convert UTC to local time.
> 
Yes, I got it.
>>
>> Any thoughts? Thanks.
> 
> I'd rather stick with UTC in logs (but perhaps make it more obvious that
> the timestamp is UTC by actually sticking that string as part of the
> timestamp - libvirt is not currently doing that).
> 
OK, I agree, will post a patch to Qemu maillist.

Regards,
-Gonglei

  reply	other threads:[~2015-05-21  2:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20  6:29 [Qemu-devel] [RFC] Can we convert UTC time to local time in Qemu Gonglei (Arei)
2015-05-20  9:00 ` Daniel P. Berrange
2015-05-20  9:28   ` Gonglei
2015-05-20 14:43 ` Eric Blake
2015-05-21  2:10   ` Gonglei [this message]
2015-05-21  3:04   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555D3E97.4000806@huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=eblake@redhat.com \
    --cc=herongguang.he@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.