WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] tools: Fix time offset when localtime=0

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] tools: Fix time offset when localtime=0
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 25 May 2010 16:25:37 -0600
Delivery-date: Tue, 25 May 2010 15:26:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.18 (X11/20081112)
A patch we've been needlessly carrying a long time  ...

Regards,
Jim


# HG changeset patch
# User Jim Fehlig <jfehlig@xxxxxxxxxx>
# 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.

    Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 14d040342c66 -r a83e97657ba0 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Tue May 25 11:13:22 2010 -0600
+++ b/tools/python/xen/xend/image.py    Tue May 25 15:26:44 2010 -0600
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] tools: Fix time offset when localtime=0, Jim Fehlig <=