qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Changing RTC from UTC to local time


From: Kyle Hayes
Subject: Re: [Qemu-devel] Changing RTC from UTC to local time
Date: Sun, 30 May 2004 18:52:25 -0700
User-agent: KMail/1.5.4

On Sunday 30 May 2004 17:29, Bartosz Fabianowski wrote:
[snip]
> With QEMU, the situation is actually much better. When you shut down
> QEMU, its RTC state is not saved anywhere and it gets initialized from
> the host's RTC the next time QEMU is run. And also, while it is running,
> QEMU keeps synchronizing its RTC with the host time. So if you run
> multiple OSes inside QEMU and if you allow any of them to adjust for
> DST, this will actually have no effect. Therefore, I don't see a problem
> with allowing the RTC to be running in local time and to allow the
> operating systems to play with it.

Of course, if the emulator takes its time from the real RTC and that has 
been changed....  Hmm, no even if the RTC is in UTC, then localtime() will 
still return daylight-savings-time-corrected time.  So, you should 
probably _always_ have the emulated OS keep away from the RTC.  The host 
OS will provide the correct time as the fake RTC value. I.e. it will 
already be changed.

> > Conclusion : setting RTC to local time is a _broken_ concept.
>
> I agree that the world would be a better - and much simpler - place if
> all RTCs ran in UTC. However, this is simply not the case. PC RTCs have
> historically always run in local time. While some PC servers may be
> handling this differently these days, it is certainly still true of
> desktops. And if I understand the idea behind QEMU right, it is to
> emulate a PC and behave like a real one would. So to follow the vast
> majority of PCs out there, QEMU should have a local time RTC by default.

Actually, while installing SuSE 9.1 yesterday, I noted that it states that 
the clock should be set to UTC unless you are dual booting.  I believe 
that most Linux distros recommend this as well.  I don't dual boot any 
machines (that's what QEMU is for!) so I haven't had this issue for a long 
time.

Best,
Kyle





reply via email to

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