From 206b7c02d53133c2aa2dbf7a4462ae13ca8cf590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 12 Jun 2017 09:52:44 +0200 Subject: [PATCH] qmemman: make sure to release lock Even when handling updated meminfo or domain list something goes wrong, make sure to release the lock - otherwise the whole qmemman will be blocked. --- qubes/tools/qmemmand.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qubes/tools/qmemmand.py b/qubes/tools/qmemmand.py index 44376bfb..b0ae55f0 100644 --- a/qubes/tools/qmemmand.py +++ b/qubes/tools/qmemmand.py @@ -143,13 +143,14 @@ class XS_Watcher(object): self.log.debug('acquiring global_lock') global_lock.acquire() self.log.debug('global_lock acquired') - if force_refresh_domain_list: - self.domain_list_changed(refresh_only=True) + try: + if force_refresh_domain_list: + self.domain_list_changed(refresh_only=True) - system_state.refresh_meminfo(domain_id, untrusted_meminfo_key) - - global_lock.release() - self.log.debug('global_lock released') + system_state.refresh_meminfo(domain_id, untrusted_meminfo_key) + finally: + global_lock.release() + self.log.debug('global_lock released') def watch_loop(self):