From 5763beb898d95e2d50a4fd683a09917e95a590b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 24 Sep 2013 06:16:52 +0200 Subject: [PATCH] HVM: do not fail on non-Xen systems (without xenstore) Currently getting Stubdom XID is (the last one?) read directly from Xenstore as there is no libvirt function for it. This means that even if HVM is running it can have not connection to Xenstore. For now give -1 in such situation. --- core-modules/01QubesHVm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-modules/01QubesHVm.py b/core-modules/01QubesHVm.py index 01407da9..720a26ae 100644 --- a/core-modules/01QubesHVm.py +++ b/core-modules/01QubesHVm.py @@ -353,6 +353,9 @@ class QubesHVm(QubesVm): if self.xid < 0: return -1 + if vmm.xs is None: + return -1 + stubdom_xid_str = vmm.xs.read('', '/local/domain/%d/image/device-model-domid' % self.xid) if stubdom_xid_str is not None: return int(stubdom_xid_str)