From c878beb25d82aff59587f5924b0517aae12af851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 26 Mar 2015 22:10:49 +0100 Subject: [PATCH] utils/block: catch an exception when talking to disconnected qubesdb This can happen for example when domain disappeared in the meantime. --- core/qubesutils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/qubesutils.py b/core/qubesutils.py index b1443d6c..caba23dd 100644 --- a/core/qubesutils.py +++ b/core/qubesutils.py @@ -241,7 +241,12 @@ def block_list_vm(vm, system_disks = False): devices_list = {} - untrusted_devices = vm.qdb.multiread('/qubes-block-devices/') + try: + untrusted_devices = vm.qdb.multiread('/qubes-block-devices/') + except DisconnectedError: + # FIXME: find some better way to do that + vm._qdb_connection = None + return {} def get_dev_item(dev, item): return untrusted_devices.get(