vm: add stubdom_xid property
Some parts (like GUI) needs to communicate with stubdomain. Lets expose it's XID at the API level.
This commit is contained in:
parent
acaada3fd9
commit
361ecdd6ac
@ -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 = []
|
||||
|
Loading…
Reference in New Issue
Block a user