Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/284'
Browse files Browse the repository at this point in the history
* origin/pr/284:
  qvm-start-daemon: handle policy denials
  • Loading branch information
marmarek committed May 15, 2024
2 parents 5486fb8 + 86d0312 commit 482f412
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions qubesadmin/tools/qvm_start_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,28 +694,32 @@ def on_connection_established(self, _subject, _event, **_kwargs):
monitor_layout = get_monitor_layout()
self.app.domains.clear_cache()
for vm in self.app.domains:
if vm.klass == 'AdminVM':
continue
try:
if vm.klass == 'AdminVM':
continue

if not self.is_watched(vm):
continue
if not self.is_watched(vm):
continue

power_state = vm.get_power_state()
if power_state == 'Running':
if "guivm" in self.enabled_services:
asyncio.ensure_future(
self.start_gui(vm, monitor_layout=monitor_layout)
)
if "audiovm" in self.enabled_services:
asyncio.ensure_future(self.start_audio(vm))
self.xid_cache[vm.name] = vm.xid, vm.stubdom_xid
elif power_state == 'Transient':
# it is still starting, we'll get 'domain-start'
# event when fully started
if "guivm" in self.enabled_services and vm.virt_mode == 'hvm':
asyncio.ensure_future(
self.start_gui_for_stubdomain(vm)
)
power_state = vm.get_power_state()
if power_state == 'Running':
if "guivm" in self.enabled_services:
asyncio.ensure_future(
self.start_gui(vm, monitor_layout=monitor_layout)
)
if "audiovm" in self.enabled_services:
asyncio.ensure_future(self.start_audio(vm))
self.xid_cache[vm.name] = vm.xid, vm.stubdom_xid
elif power_state == 'Transient':
# it is still starting, we'll get 'domain-start'
# event when fully started
if "guivm" in self.enabled_services \
and vm.virt_mode == 'hvm':
asyncio.ensure_future(
self.start_gui_for_stubdomain(vm)
)
except qubesadmin.exc.QubesDaemonCommunicationError as e:
vm.log.warning("Failed to handle %s: %s", vm.name, str(e))

def on_domain_stopped(self, vm, _event, **_kwargs):
"""Handler of 'domain-stopped' event, cleans up"""
Expand Down

0 comments on commit 482f412

Please sign in to comment.