qvm-start-daemon: ensure separate task between GUI/AUDIO

This commit is contained in:
Frédéric Pierret (fepitre) 2020-01-18 19:28:44 +01:00
parent 05e479cf92
commit 49957971ff
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2

View File

@ -382,21 +382,17 @@ class DAEMONLauncher:
"""Handler of 'domain-start' event, starts GUI/AUDIO daemon for """Handler of 'domain-start' event, starts GUI/AUDIO daemon for
actual VM """ actual VM """
try: try:
if getattr(vm, 'guivm', None) != vm.app.local_name: if getattr(vm, 'guivm', None) == vm.app.local_name and \
return vm.features.check_with_template('gui', True) and \
if not vm.features.check_with_template('gui', True): kwargs.get('start_guid', 'True') == 'True':
return
if kwargs.get('start_guid', 'True') == 'True':
asyncio.ensure_future(self.start_gui_for_vm(vm)) asyncio.ensure_future(self.start_gui_for_vm(vm))
except qubesadmin.exc.QubesException as e: except qubesadmin.exc.QubesException as e:
vm.log.warning('Failed to start GUI for %s: %s', vm.name, str(e)) vm.log.warning('Failed to start GUI for %s: %s', vm.name, str(e))
try: try:
if getattr(vm, 'audiovm', None) != vm.app.local_name: if getattr(vm, 'audiovm', None) == vm.app.local_name and \
return vm.features.check_with_template('audio', True) and \
if not vm.features.check_with_template('audio', True): kwargs.get('start_audio', 'True') == 'True':
return
if kwargs.get('start_audio', 'True') == 'True':
asyncio.ensure_future(self.start_audio_for_vm(vm)) asyncio.ensure_future(self.start_audio_for_vm(vm))
except qubesadmin.exc.QubesException as e: except qubesadmin.exc.QubesException as e:
vm.log.warning('Failed to start AUDIO for %s: %s', vm.name, str(e)) vm.log.warning('Failed to start AUDIO for %s: %s', vm.name, str(e))