Skip to content

Commit

Permalink
qvm-start-daemon: one more pass on isolating services
Browse files Browse the repository at this point in the history
  • Loading branch information
fepitre committed Apr 23, 2024
1 parent 9637991 commit 27e7af5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions qubesadmin/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ def send_monitor_layout_all(self):
if vm.is_running():
if not vm.features.check_with_template('gui', True):
continue
asyncio.ensure_future(self.send_monitor_layout(vm,
monitor_layout))
asyncio.ensure_future(
self.send_monitor_layout(vm, monitor_layout)
)

@staticmethod
def kde_guid_args(vm):
Expand Down Expand Up @@ -647,7 +648,8 @@ def on_domain_spawn(self, vm, _event, **kwargs):
return

try:
if getattr(vm, 'guivm', None) != vm.app.local_name:
if ('guivm' in self.enabled_services and
getattr(vm, 'guivm', None) != vm.app.local_name):
return
if not vm.features.check_with_template('gui', True) and \
not vm.features.check_with_template('gui-emulated', True):
Expand All @@ -668,17 +670,19 @@ def on_domain_start(self, vm, _event, **kwargs):
self.xid_cache[vm.name] = vm.xid, vm.stubdom_xid

try:
if getattr(vm, 'guivm', None) == vm.app.local_name and \
vm.features.check_with_template('gui', True) and \
kwargs.get('start_guid', 'True') == 'True':
if ('guivm' in self.enabled_services and
getattr(vm, 'guivm', None) == vm.app.local_name and
vm.features.check_with_template('gui', True) and
kwargs.get('start_guid', 'True') == 'True'):
asyncio.ensure_future(self.start_gui_for_vm(vm))
except qubesadmin.exc.QubesException as e:
vm.log.warning('Failed to start GUI for %s: %s', vm.name, str(e))

try:
if getattr(vm, 'audiovm', None) == vm.app.local_name and \
vm.features.check_with_template('audio', True) and \
kwargs.get('start_audio', 'True') == 'True':
if ('audiovm' in self.enabled_services
and getattr(vm, 'audiovm', None) == vm.app.local_name and
vm.features.check_with_template('audio', True) and
kwargs.get('start_audio', 'True') == 'True'):
asyncio.ensure_future(self.start_audio_for_vm(vm))
except qubesadmin.exc.QubesException as e:
vm.log.warning('Failed to start AUDIO for %s: %s', vm.name, str(e))
Expand Down Expand Up @@ -708,7 +712,7 @@ def on_connection_established(self, _subject, _event, **_kwargs):
elif power_state == 'Transient':
# it is still starting, we'll get 'domain-start'
# event when fully started
if vm.virt_mode == 'hvm' and "guivm" in self.enabled_services:
if "guivm" in self.enabled_services and vm.virt_mode == 'hvm':
asyncio.ensure_future(
self.start_gui_for_stubdomain(vm)
)
Expand Down

0 comments on commit 27e7af5

Please sign in to comment.