Merge remote-tracking branch 'qubesos/pr/82'

* qubesos/pr/82:
  Check if VM needs killing before murdering it
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-28 16:42:55 +02:00
commit 91fbc43b5e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 9 additions and 1 deletions

View File

@ -192,7 +192,12 @@ class VmShutdownMonitor(QtCore.QObject):
self.tr("Wait another {0} seconds...").format(
self.shutdown_time / 1000))
if reply == 0:
vm.kill()
try:
vm.kill()
except exc.QubesVMNotStartedError:
# the VM shut down while the user was thinking about
# shutting it down
pass
self.restart_vm_if_needed()
else:
self.shutdown_started = datetime.now()

View File

@ -4,3 +4,6 @@
class QubesException(BaseException):
pass
class QubesVMNotStartedError(BaseException):
pass