On startup-failure only force_shutdown if running

This avoids losing the exception if an exception is raised in
self.force_shutdown(), because the vm is not running or paused
This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-04-05 18:23:01 +02:00 committed by Wojtek Porczyk
parent 2a9752716c
commit 6aac0a5732

View File

@ -691,8 +691,11 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
self.fire_event('domain-start',
preparing_dvm=preparing_dvm, start_guid=start_guid)
except: # pylint: disable=bare-except
self.force_shutdown()
except: # pylint: disable=bare-except
if self.is_running() or self.is_paused():
# This avoids losing the exception if an exception is raised in
# self.force_shutdown(), because the vm is not running or paused
self.force_shutdown()
raise