core: fix handling vm.start_time for just shutdown VM

That xenstore entry may be already removed even when libvirt still
reports the VM as running.

Fix QubesOS/qubes-issues#2127
This commit is contained in:
Marek Marczykowski-Górecki 2016-07-01 00:47:32 +02:00
parent 03210f6cfe
commit 8c7f072461
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -967,7 +967,7 @@ class QubesVm(object):
uuid = self.uuid
start_time = vmm.xs.read('', "/vm/%s/start_time" % str(uuid))
if start_time != '':
if start_time:
return datetime.datetime.fromtimestamp(float(start_time))
else:
return None