1
0

Check if VM needs killing before murdering it

In some cases, when the user waited some time before force-killing a VM,
it could be already dead.

fixes QubesOS/qubes-issues#3730
Dieser Commit ist enthalten in:
Marta Marczykowska-Górecka 2018-03-24 22:53:22 +01:00
Ursprung 2d6b6488ea
Commit 20cabb5563
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 9A752C30B26FD04B
2 geänderte Dateien mit 9 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -192,7 +192,12 @@ class VmShutdownMonitor(QtCore.QObject):
self.tr("Wait another {0} seconds...").format( self.tr("Wait another {0} seconds...").format(
self.shutdown_time / 1000)) self.shutdown_time / 1000))
if reply == 0: 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() self.restart_vm_if_needed()
else: else:
self.shutdown_started = datetime.now() self.shutdown_started = datetime.now()

Datei anzeigen

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