VmShutdownMonitor: Check if running VM hasn't just restarted (#231)

This commit is contained in:
Marek Marczykowski 2011-05-12 19:08:15 +02:00
parent 4c5ecc6011
commit ff0a2ff09e

View File

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