qubes.py: postpone qmmeman.close()
There are indications that when parent "xl" process exits, the domain is not booted completely; and xl actions may interfere with qmemman memory balancing. Thus, in VM.start(), we delay releasing of qmemman handle until qrexec_daemon connects successfully.
This commit is contained in:
parent
abd8b79864
commit
73ec4f595b
@ -943,8 +943,6 @@ class QubesVm(object):
|
|||||||
subprocess.check_call(xl_cmdline)
|
subprocess.check_call(xl_cmdline)
|
||||||
except:
|
except:
|
||||||
raise QubesException("Failed to load VM config")
|
raise QubesException("Failed to load VM config")
|
||||||
finally:
|
|
||||||
qmemman_client.close() # let qmemman_daemon resume balancing
|
|
||||||
|
|
||||||
xid = self.get_xid()
|
xid = self.get_xid()
|
||||||
self.xid = xid
|
self.xid = xid
|
||||||
@ -976,6 +974,13 @@ class QubesVm(object):
|
|||||||
self.force_shutdown()
|
self.force_shutdown()
|
||||||
raise OSError ("ERROR: Cannot execute qrexec_daemon!")
|
raise OSError ("ERROR: Cannot execute qrexec_daemon!")
|
||||||
|
|
||||||
|
# close() is not really needed, because the descriptor is close-on-exec
|
||||||
|
# anyway, the reason to postpone close() is that possibly xl is not done
|
||||||
|
# constructing the domain after its main process exits
|
||||||
|
# so we close() when we know the domain is up
|
||||||
|
# the successful qrexec connect is a good indicator of it
|
||||||
|
qmemman_client.close()
|
||||||
|
|
||||||
if preparing_dvm:
|
if preparing_dvm:
|
||||||
if verbose:
|
if verbose:
|
||||||
print "--> Preparing config template for DispVM"
|
print "--> Preparing config template for DispVM"
|
||||||
|
Loading…
Reference in New Issue
Block a user