diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index db1bfba2..2f0067f3 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -654,9 +654,8 @@ class QubesVm(object): @property def qdb(self): if self._qdb_connection is None: - if self.is_running(): - from qubes.qdb import QubesDB - self._qdb_connection = QubesDB(self.name) + from qubes.qdb import QubesDB + self._qdb_connection = QubesDB(self.name) return self._qdb_connection @property @@ -705,6 +704,10 @@ class QubesVm(object): # obsoleted return self.uuid + def refresh(self): + self._libvirt_domain = None + self._qdb_connection = None + def get_mem(self): if dry_run: return 666 diff --git a/core/qubesutils.py b/core/qubesutils.py index caba23dd..5c92d75c 100644 --- a/core/qubesutils.py +++ b/core/qubesutils.py @@ -244,8 +244,7 @@ def block_list_vm(vm, system_disks = False): try: untrusted_devices = vm.qdb.multiread('/qubes-block-devices/') except DisconnectedError: - # FIXME: find some better way to do that - vm._qdb_connection = None + vm.refresh() return {} def get_dev_item(dev, item):