Skip to contentSkip to conversation

tools: Fix time offset when localtime=0

PATCH New Jim Fehlig 1 participant 1 message May 25, 2010

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 tools: Fix time offset when localtime=0

A patch we've been needlessly carrying a long time ...

Regards,
Jim

# HG changeset patch
# User Jim Fehlig <[email protected]>
# Date 1274822804 21600
# Node ID a83e97657ba0f3ea232fe0dfb9edccf8e28aa982 # Parent 14d040342c6618365750b2c3b96ca01ff4a5e5dd
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.

tools/python/xen/xend/image.py +1 -1
diff -r 14d040342c66 -r a83e97657ba0 tools/python/xen/xend/image.py
@@ -129,7 +129,7 @@
         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:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel