vm/qubesvm: fix race condition in failed startup handling
Instead of checking if domain is still running/paused, try to kill it anyway and ignore appropriate exception. Otherwise domain could die before the check and killing.
This commit is contained in:
parent
4e5a14774a
commit
a9ec2bb2c3
@ -1068,8 +1068,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
# This avoids losing the exception if an exception is
|
# This avoids losing the exception if an exception is
|
||||||
# raised in self.force_shutdown(), because the vm is not
|
# raised in self.force_shutdown(), because the vm is not
|
||||||
# running or paused
|
# running or paused
|
||||||
if self.is_running() or self.is_paused():
|
try:
|
||||||
yield from self._kill_locked()
|
yield from self._kill_locked()
|
||||||
|
except qubes.exc.QubesVMNotStartedError:
|
||||||
|
pass
|
||||||
|
|
||||||
# let anyone receiving domain-pre-start know that startup failed
|
# let anyone receiving domain-pre-start know that startup failed
|
||||||
yield from self.fire_event_async('domain-start-failed',
|
yield from self.fire_event_async('domain-start-failed',
|
||||||
|
Loading…
Reference in New Issue
Block a user