Skip to content

Commit c763da4

Browse files
committed
Inform how to debug failed preload startup
The "domain-start-failed" has to be fired before the domain is killed, as the qube is unregistered from clients when it is removed/powered off. Fixes: QubesOS/qubes-issues#10200 For: QubesOS/qubes-issues#1512
1 parent a930d4e commit c763da4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

qubes/vm/dispvm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,13 @@ async def on_domain_started_dispvm(
373373
except asyncio.TimeoutError:
374374
raise qubes.exc.QubesException(
375375
"Timed out call to '%s' after '%d' seconds during preload "
376-
"startup" % (service, timeout)
376+
"startup" % (rpc, timeout)
377377
)
378378
except (subprocess.CalledProcessError, qubes.exc.QubesException):
379379
raise qubes.exc.QubesException(
380-
"Error on call to '%s' during preload startup" % service
380+
"Error on call to '%s' during preload startup. To debug, run "
381+
"the following on a new disposable of '%s': systemctl "
382+
"--failed" % (rpc, self.template)
381383
)
382384

383385
if not self.preload_requested:

qubes/vm/qubesvm.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,18 +1548,17 @@ async def start(
15481548

15491549
except Exception as exc: # pylint: disable=bare-except
15501550
self.log.error("Start failed: %s", str(exc))
1551+
# let anyone receiving domain-pre-start know that startup failed
1552+
await self.fire_event_async(
1553+
"domain-start-failed", reason=str(exc)
1554+
)
15511555
# This avoids losing the exception if an exception is
15521556
# raised in self.kill(), because the vm is not
15531557
# running or paused
15541558
try:
15551559
await self.kill()
15561560
except qubes.exc.QubesVMNotStartedError:
15571561
pass
1558-
1559-
# let anyone receiving domain-pre-start know that startup failed
1560-
await self.fire_event_async(
1561-
"domain-start-failed", reason=str(exc)
1562-
)
15631562
raise
15641563

15651564
return self

0 commit comments

Comments
 (0)