use function to determine pacat domid
This commit is contained in:
parent
ec90829695
commit
d99045f05e
@ -275,6 +275,15 @@ class DAEMONLauncher:
|
|||||||
"""Helper function to construct an AUDIO pidfile path"""
|
"""Helper function to construct an AUDIO pidfile path"""
|
||||||
return '/var/run/qubes/pacat.{}'.format(xid)
|
return '/var/run/qubes/pacat.{}'.format(xid)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def pacat_domid(vm):
|
||||||
|
"""Determine target domid for an AUDIO daemon"""
|
||||||
|
xid = vm.stubdom_xid \
|
||||||
|
if vm.features.check_with_template('audio-model', False) \
|
||||||
|
and vm.virt_mode == 'hvm' \
|
||||||
|
else vm.xid
|
||||||
|
return xid
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def start_gui_for_vm(self, vm, monitor_layout=None):
|
def start_gui_for_vm(self, vm, monitor_layout=None):
|
||||||
"""Start GUI daemon (qubes-guid) connected directly to a VM
|
"""Start GUI daemon (qubes-guid) connected directly to a VM
|
||||||
@ -341,10 +350,7 @@ class DAEMONLauncher:
|
|||||||
:param vm: VM for which start AUDIO daemon
|
:param vm: VM for which start AUDIO daemon
|
||||||
"""
|
"""
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
xid = vm.stubdom_xid if vm.features.check_with_template('audio-model', False) \
|
pacat_cmd = [PACAT_DAEMON_PATH, '-l', self.pacat_domid(vm), vm.name]
|
||||||
and vm.virt_mode == 'hvm' else vm.xid
|
|
||||||
|
|
||||||
pacat_cmd = [PACAT_DAEMON_PATH, '-l', xid, vm.name]
|
|
||||||
vm.log.info('Starting AUDIO')
|
vm.log.info('Starting AUDIO')
|
||||||
|
|
||||||
yield from asyncio.create_subprocess_exec(*pacat_cmd)
|
yield from asyncio.create_subprocess_exec(*pacat_cmd)
|
||||||
@ -390,9 +396,7 @@ class DAEMONLauncher:
|
|||||||
if not vm.features.check_with_template('audio', True):
|
if not vm.features.check_with_template('audio', True):
|
||||||
return
|
return
|
||||||
|
|
||||||
xid = vm.stubdom_xid if vm.features.check_with_template('audio-model', False) \
|
xid = self.pacat_domid(vm)
|
||||||
and vm.virt_mode == 'hvm' else vm.xid
|
|
||||||
|
|
||||||
if not os.path.exists(self.pacat_pidfile(xid)):
|
if not os.path.exists(self.pacat_pidfile(xid)):
|
||||||
yield from self.start_audio_for_vm(vm)
|
yield from self.start_audio_for_vm(vm)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user