From 0bfde448561e1e6f723e436bd4562e3b7cd764ee Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 26 May 2010 08:29:15 +0100 Subject: [PATCH] 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 xen-unstable changeset: 21460:15f4ead9e686 xen-unstable date: Wed May 26 08:15:31 2010 +0100 --- tools/python/xen/xend/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index cb5f6350e6..144f4f846a 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -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: