소스 검색

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.
Marek Marczykowski-Górecki 10 년 전
부모
커밋
5763beb898
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      core-modules/01QubesHVm.py

+ 3 - 0
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)