qubes/vm: disconnect from old QubesDB when going to start new instance

QubesDB daemon no longer remove socket created by new instance, so one
part of VM restart race condition is solved. The only remaining part is
to ensure that we really connect to the new instance, instead of talking
to the old one (soon to be terminated).

Fixes QubesOS/qubes-issues#1694
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-04 13:28:01 +01:00
parent 3b209515c2
commit 8f443547fb
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1173,9 +1173,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
:raises OSError: when starting fails.
'''
self.log.info('Starting Qubes DB')
# drop old connection to QubesDB, if any
self._qdb_connection = None
# FIXME #1694 #1241
self.log.info('Starting Qubes DB')
try:
self.start_daemon([
qubes.config.system_path["qubesdb_daemon_path"],