mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
tools: Fix time offset when localtime=0
localtime can be stored in vm config as a string, resulting in incorrect calculation of rtc_timeoffset. Cast localtime to int to ensure rtc_timeoffset is calculated properly. Signed-off-by: Jim Fehlig <jfehlig@novell.com> xen-unstable changeset: 21460:15f4ead9e686 xen-unstable date: Wed May 26 08:15:31 2010 +0100
This commit is contained in:
1 parent
1a830511d1
commit
0bfde44856
1 file changed
+1
-1
@@ -129,7 +129,7 @@ class ImageHandler:
|
||||
self.dmargs = self.parseDeviceModelArgs(vmConfig)
|
||||
self.pid = None
|
||||
rtc_timeoffset = int(vmConfig['platform'].get('rtc_timeoffset', 0))
|
||||
if vmConfig['platform'].get('localtime', 0):
|
||||
if int(vmConfig['platform'].get('localtime', 0)):
|
||||
if time.localtime(time.time())[8]:
|
||||
rtc_timeoffset -= time.altzone
|
||||
else:
|
||||
|
||||