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-changelog

[Xen-changelog] [xen-3.1-testing] xend: Improve localtime calculation --

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] xend: Improve localtime calculation -- Python time module already
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 01 Apr 2008 02:00:24 -0700
Delivery-date: Tue, 01 Apr 2008 02:00:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206978113 -3600
# Node ID fe766402a150c57f1dfaa9c13bc7606dfa237a7b
# Parent  b7a6855a710ddcd6a5066d96fcb592c1f0fb576b
xend: Improve localtime calculation -- Python time module already
provides the relevant information.

From: Ross Walker <rwalker@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   17323:d24f37b31030bdc9305e40a9a71846e6f79909d7
xen-unstable date:        Mon Mar 31 10:40:43 2008 +0100
---
 tools/python/xen/xend/XendDomainInfo.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r b7a6855a710d -r fe766402a150 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:41:24 2008 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 31 16:41:53 2008 +0100
@@ -1583,11 +1583,10 @@ class XendDomainInfo:
 
         try:
             if self.info['platform'].get('localtime', 0):
-                t = time.time()
-                loc = time.localtime(t)
-                utc = time.gmtime(t)
-                timeoffset = int(time.mktime(loc) - time.mktime(utc))
-                self.info['platform']['rtc_timeoffset'] = timeoffset
+                if time.localtime(time.time())[8]:
+                    self.info['platform']['rtc_timeoffset'] = -time.altzone
+                else:
+                    self.info['platform']['rtc_timeoffset'] = -time.timezone
 
             self.image = image.create(self, self.info)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] xend: Improve localtime calculation -- Python time module already, Xen patchbot-3.1-testing <=