From 3c7f8b97cda961e74e256019b2d6782c14275a03 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 1 Oct 2011 02:54:18 +0200 Subject: [PATCH] dom0: return datatime value in get_start_time (#315) --- dom0/qvm-core/qubes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 4aee678f..0bf4a1c8 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -534,15 +534,17 @@ class QubesVm(object): def get_start_time(self): if not self.is_running(): - return 0 + return None dominfo = self.get_xl_dominfo() uuid = self.get_uuid() start_time = xs.read('', "/vm/%s/start_time" % str(uuid)) - - return start_time + if start_time != '': + return datetime.datetime.fromtimestamp(float(start_time)) + else: + return None def is_outdated(self): # Makes sense only on VM based on template