@@ -87,8 +87,8 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
87
87
88
88
- Full start: Preloaded disposable must only be interrupted
89
89
(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 .
92
92
93
93
- **Prevents accidental tampering**:
94
94
@@ -102,12 +102,11 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
102
102
GUI applications, that is a bug because features cannot be set before
103
103
that event.
104
104
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.
111
110
112
111
**Features and properties relationship on stages**:
113
112
@@ -136,14 +135,6 @@ class DispVM(qubes.vm.qubesvm.QubesVM):
136
135
applicable). Only in this phase, GUI applications treat the qube as any
137
136
other unnamed disposable and the qube object is returned to the caller if
138
137
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).
147
138
"""
148
139
149
140
template = qubes .VMProperty (
@@ -341,43 +332,33 @@ async def on_domain_started_dispvm(
341
332
"""
342
333
if not self .is_preload :
343
334
return
344
- # TODO: pause is late for autostarted GUI applications
345
- # https://github.com/QubesOS/qubes-issues/issues/9907
346
335
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 + ")"
355
340
try :
356
341
self .log .info (
357
342
"Preload startup waiting '%s' with '%d' seconds timeout" ,
358
343
service ,
359
344
timeout ,
360
345
)
361
- runner = self .run_service_for_stdio if gui else self .run_for_stdio
362
346
await asyncio .wait_for (
363
- runner (
347
+ self . run (
364
348
service ,
365
349
stdout = subprocess .DEVNULL ,
366
350
stderr = subprocess .DEVNULL ,
367
351
),
368
352
timeout = timeout ,
369
353
)
370
354
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
374
355
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 )
377
358
)
378
359
except (subprocess .CalledProcessError , qubes .exc .QubesException ):
379
360
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
381
362
)
382
363
383
364
if not self .preload_requested :
@@ -397,11 +378,11 @@ def on_domain_paused(
397
378
if self .is_preload :
398
379
self .log .info ("Paused preloaded qube" )
399
380
400
- @qubes .events .handler ("domain-pre- unpaused" )
401
- def on_domain_pre_unpaused (
381
+ @qubes .events .handler ("domain-unpaused" )
382
+ def on_domain_unpaused (
402
383
self , event , ** kwargs
403
384
): # pylint: disable=unused-argument
404
- """Mark preloaded domains as used before being unpaused ."""
385
+ """Mark preloaded disposables as used."""
405
386
# Qube start triggers unpause via 'libvirt_domain.resume()'.
406
387
if self .is_preload and self .is_fully_usable ():
407
388
self .log .info ("Unpaused preloaded qube will be marked as used" )
0 commit comments