From 384dbf4d9cf8435b23ea24c46f0bf4b4d5ce5c70 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 30 Sep 2011 20:39:39 +0200 Subject: [PATCH] fix vm_start_time comparison race (#315) --- qubesmanager/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 6f68e11..189b76f 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -329,7 +329,8 @@ class VmShutdownMonitor(QObject): def check_if_vm_has_shutdown(self): vm = self.vm - if not vm.is_running() or vm.get_start_time() >= datetime.utcnow() - timedelta(0,vm_shutdown_timeout/1000): + vm_start_time = vm.get_start_time() + if not vm.is_running() or (vm_start_time and vm_start_time >= datetime.utcnow() - timedelta(0,vm_shutdown_timeout/1000)): if vm.is_template(): trayIcon.showMessage ("Qubes Manager", "You have just modified template '{0}'. You should now restart all the VMs based on it, so they could see the changes.".format(vm.name), msecs=8000) return