core: improve handling QubesDB startup errors
Kill the VM when QubesDB initialization fails, in any way, not only QubesDB daemon itself.
This commit is contained in:
parent
5c549e1134
commit
75168c8aef
@ -1759,7 +1759,6 @@ class QubesVm(object):
|
|||||||
str(self.xid),
|
str(self.xid),
|
||||||
self.name])
|
self.name])
|
||||||
if retcode != 0:
|
if retcode != 0:
|
||||||
self.force_shutdown()
|
|
||||||
raise OSError("ERROR: Cannot execute qubesdb-daemon!")
|
raise OSError("ERROR: Cannot execute qubesdb-daemon!")
|
||||||
|
|
||||||
def request_memory(self, mem_required = None):
|
def request_memory(self, mem_required = None):
|
||||||
@ -1833,6 +1832,7 @@ class QubesVm(object):
|
|||||||
|
|
||||||
self.libvirt_domain.createWithFlags(libvirt.VIR_DOMAIN_START_PAUSED)
|
self.libvirt_domain.createWithFlags(libvirt.VIR_DOMAIN_START_PAUSED)
|
||||||
|
|
||||||
|
try:
|
||||||
if verbose:
|
if verbose:
|
||||||
print >> sys.stderr, "--> Starting Qubes DB..."
|
print >> sys.stderr, "--> Starting Qubes DB..."
|
||||||
self.start_qubesdb()
|
self.start_qubesdb()
|
||||||
@ -1858,6 +1858,9 @@ class QubesVm(object):
|
|||||||
for hook in self.hooks_start:
|
for hook in self.hooks_start:
|
||||||
hook(self, verbose = verbose, preparing_dvm = preparing_dvm,
|
hook(self, verbose = verbose, preparing_dvm = preparing_dvm,
|
||||||
start_guid = start_guid, notify_function = notify_function)
|
start_guid = start_guid, notify_function = notify_function)
|
||||||
|
except:
|
||||||
|
self.force_shutdown()
|
||||||
|
raise
|
||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print >> sys.stderr, "--> Starting the VM..."
|
print >> sys.stderr, "--> Starting the VM..."
|
||||||
|
Loading…
Reference in New Issue
Block a user