From ef6095662e9ddeb101c0065b86bac3602f9b8fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 25 Sep 2015 22:02:53 +0200 Subject: [PATCH] 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 --- core/qubesutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/qubesutils.py b/core/qubesutils.py index 120d4a98..feaf1407 100644 --- a/core/qubesutils.py +++ b/core/qubesutils.py @@ -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)