@@ -87,8 +87,8 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
8787
8888 - Full start: Preloaded disposable must only be interrupted
8989 (paused/suspended) or used after all basic services in it have been
90- started. Autostarted applications allows user interaction before the it
91- should, that is a bug .
90+ started. Failure to complete this step must remove the qube from the
91+ preload list .
9292
9393 - **Prevents accidental tampering**:
9494
@@ -102,12 +102,11 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
102102 GUI applications, that is a bug because features cannot be set before
103103 that event.
104104
105- - Preloaded qubes must be marked as used when prior to being
106- unpaused/resumed, even if it was not requested. The goal of
107- pause/suspend in case of preloaded disposables is mostly detecting
108- whether a qube was used or not, and not managing resource consumption;
109- thus, even with abundant system resources, they should not be
110- unpaused/resumed without being requested.
105+ - Preloaded qubes must be marked as used after being unpaused/resumed,
106+ even if it was not requested. The goal of pause/suspend in case of
107+ preloaded disposables is mostly detecting whether a qube was used or
108+ not, not managing resource consumption; thus, even with abundant system
109+ resources, they should not be unpaused/resumed without being requested.
111110
112111 **Features and properties relationship on stages**:
113112
@@ -136,14 +135,6 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
136135 applicable). Only in this phase, GUI applications treat the qube as any
137136 other unnamed disposable and the qube object is returned to the caller if
138137 requested.
139-
140- **Outstanding bugs**:
141-
142- - GUI applications set to autostart can appear on the screen and be
143- interactive for a brief moment before the qube is allowed to be used
144- followed by a sudden freeze.
145- - Can't interrupt qubes before the GUI session has started if the qube's
146- usage will require a GUI (GUI daemon cannot handle an interrupted qube).
147138 """
148139
149140 template = qubes .VMProperty (
@@ -341,43 +332,33 @@ async def on_domain_started_dispvm(
341332 """
342333 if not self .is_preload :
343334 return
344- # TODO: pause is late for autostarted GUI applications
345- # https://github.com/QubesOS/qubes-issues/issues/9907
346335 timeout = self .qrexec_timeout
347- gui = bool (self .guivm and self .features .get ("gui" , True ))
348- service = "qubes.WaitForSession"
349- if not gui :
350- # https://github.com/QubesOS/qubes-issues/issues/9964
351- # service = "qubes.WaitForRunningSystem"
352- rpc = "qubes.WaitForRunningSystem"
353- path = "/run/qubes-rpc:/usr/local/etc/qubes-rpc:/etc/qubes-rpc"
354- service = '$(PATH="' + path + '" command -v ' + rpc + ")"
336+ # https://github.com/QubesOS/qubes-issues/issues/9964
337+ rpc = "qubes.WaitForRunningSystem"
338+ path = "/run/qubes-rpc:/usr/local/etc/qubes-rpc:/etc/qubes-rpc"
339+ service = '$(PATH="' + path + '" command -v ' + rpc + ")"
355340 try :
356341 self .log .info (
357342 "Preload startup waiting '%s' with '%d' seconds timeout" ,
358343 service ,
359344 timeout ,
360345 )
361- runner = self .run_service_for_stdio if gui else self .run_for_stdio
362346 await asyncio .wait_for (
363- runner (
347+ self . run (
364348 service ,
365349 stdout = subprocess .DEVNULL ,
366350 stderr = subprocess .DEVNULL ,
367351 ),
368352 timeout = timeout ,
369353 )
370354 except asyncio .TimeoutError :
371- # TODO: if pause occurs before the GUI session starts (on boot
372- # before login manager), results in an unusable GUI for the qube:
373- # https://github.com/QubesOS/qubes-issues/issues/9940
374355 raise qubes .exc .QubesException (
375- "Timed out Qrexec call to '%s' after '%d' seconds during "
376- "preload startup" % (service , timeout )
356+ "Timed out call to '%s' after '%d' seconds during preload "
357+ "startup" % (service , timeout )
377358 )
378359 except (subprocess .CalledProcessError , qubes .exc .QubesException ):
379360 raise qubes .exc .QubesException (
380- "Error on Qrexec call to '%s' during preload startup" % service
361+ "Error on call to '%s' during preload startup" % service
381362 )
382363
383364 if not self .preload_requested :
@@ -397,11 +378,11 @@ def on_domain_paused(
397378 if self .is_preload :
398379 self .log .info ("Paused preloaded qube" )
399380
400- @qubes .events .handler ("domain-pre- unpaused" )
401- def on_domain_pre_unpaused (
381+ @qubes .events .handler ("domain-unpaused" )
382+ def on_domain_unpaused (
402383 self , event , ** kwargs
403384 ): # pylint: disable=unused-argument
404- """Mark preloaded domains as used before being unpaused ."""
385+ """Mark preloaded disposables as used."""
405386 # Qube start triggers unpause via 'libvirt_domain.resume()'.
406387 if self .is_preload and self .is_fully_usable ():
407388 self .log .info ("Unpaused preloaded qube will be marked as used" )
0 commit comments