From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BUbys-0004nO-9U for qemu-devel@nongnu.org; Sun, 30 May 2004 21:52:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BUbyq-0004m6-5D for qemu-devel@nongnu.org; Sun, 30 May 2004 21:52:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BUbyq-0004lw-2o for qemu-devel@nongnu.org; Sun, 30 May 2004 21:52:48 -0400 Received: from [24.21.209.245] (helo=pdx.silverbeach.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BUbyT-0004BI-8c for qemu-devel@nongnu.org; Sun, 30 May 2004 21:52:26 -0400 Received: from localhost (localhost [127.0.0.1]) by pdx.silverbeach.net (Postfix) with ESMTP id 60B0F1BF33C for ; Sun, 30 May 2004 18:52:26 -0700 (PDT) From: Kyle Hayes Subject: Re: [Qemu-devel] Changing RTC from UTC to local time Date: Sun, 30 May 2004 18:52:25 -0700 References: <40B8A0B1.3040601@fabianowski.de> <20040530215949.GB5521@lebarbe.net> <40BA7C79.1070703@fabianowski.de> In-Reply-To: <40BA7C79.1070703@fabianowski.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200405301852.25158.kyle@silverbeach.net> Reply-To: kyle@silverbeach.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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