Skip to content

Commit

Permalink
winusb: check if qrexec running for the stubdom
Browse files Browse the repository at this point in the history
  • Loading branch information
easydozen committed Feb 16, 2021
1 parent 21d67b2 commit a2e4dbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qubes/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ async def run_service(self, service, source=None, user=None, stubdom=False,
raise qubes.exc.QubesVMNotRunningError(self)
await self.start(start_guid=gui)

if not self.is_qrexec_running():
if not self.is_qrexec_running(stubdom=stubdom):
raise qubes.exc.QubesVMError(
self, 'Domain {!r}: qrexec not connected'.format(name))

Expand Down Expand Up @@ -1974,7 +1974,7 @@ def is_paused(self):
return self.libvirt_domain \
and self.libvirt_domain.state()[0] == libvirt.VIR_DOMAIN_PAUSED

def is_qrexec_running(self):
def is_qrexec_running(self, stubdom=False):
"""Check whether qrexec for this domain is available.
:returns: :py:obj:`True` if qrexec is running, \
Expand All @@ -1983,7 +1983,8 @@ def is_qrexec_running(self):
"""
if self.xid < 0: # pylint: disable=comparison-with-callable
return False
return os.path.exists('/var/run/qubes/qrexec.%s' % self.name)
name = self.name + '-dm' if stubdom else self.name
return os.path.exists('/var/run/qubes/qrexec.%s' % name)

def is_fully_usable(self):
return all(self.fire_event('domain-is-fully-usable'))
Expand Down

0 comments on commit a2e4dbf

Please sign in to comment.