utils/QubesWatch: register domain watches on VIR_DOMAIN_EVENT_RESUMED

QubesVM.start() first creates domain as paused, completes its setup
(including starting qubesdb-daemon and creating appropriate entries),
then resumes the domain. So wait for that resume to be sure that
`qubesdb-daemon` is already running and populated.

QubesOS/qubes-issues#1110
This commit is contained in:
Marek Marczykowski-Górecki 2015-09-25 22:02:53 +02:00
parent 5f0d564051
commit ef6095662e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -835,7 +835,9 @@ class QubesWatch(object):
del(self._qdb[name])
def _domain_list_changed(self, conn, domain, event, reason, param):
if event == libvirt.VIR_DOMAIN_EVENT_STARTED:
# use VIR_DOMAIN_EVENT_RESUMED instead of VIR_DOMAIN_EVENT_STARTED to
# make sure that qubesdb daemon is already running
if event == libvirt.VIR_DOMAIN_EVENT_RESUMED:
self._register_watches(domain)
elif event == libvirt.VIR_DOMAIN_EVENT_STOPPED:
self._unregister_watches(domain)