diff --git a/qubesmanager/main.py b/qubesmanager/main.py index c73d214..d829f9f 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -43,6 +43,7 @@ from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, Pro import subprocess import time import threading +from datetime import datetime,timedelta qubes_guid_path = '/usr/bin/qubes_guid' @@ -327,7 +328,7 @@ class VmShutdownMonitor(QObject): def check_if_vm_has_shutdown(self): vm = self.vm - if not vm.is_running(): + if not vm.is_running() or vm.get_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