vm: add stubdom_xid property

Some parts (like GUI) needs to communicate with stubdomain. Lets expose
it's XID at the API level.
这个提交包含在:
Marek Marczykowski-Górecki 2017-04-14 23:13:40 +02:00
父节点 acaada3fd9
当前提交 361ecdd6ac
找不到此签名对应的密钥
GPG 密钥 ID: 063938BA42CFA724

查看文件

@ -521,6 +521,21 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
e.get_error_code()))
raise
@qubes.stateless_property
def stubdom_xid(self):
if self.xid < 0:
return -1
if self.app.vmm.xs is None:
return -1
stubdom_xid_str = self.app.vmm.xs.read('',
'/local/domain/{}/image/device-model-domid'.format(self.xid))
if stubdom_xid_str is None or not stubdom_xid_str.isdigit():
return -1
return int(stubdom_xid_str)
@property
def attached_volumes(self):
result = []