Skip to content

Commit 67ab137

Browse files
committed
Handle preloaded disposables
Documentation and skip cloning qube specific features. For: QubesOS/qubes-issues#1512
1 parent bb04694 commit 67ab137

File tree

2 files changed

+77
-3
lines changed

2 files changed

+77
-3
lines changed

doc/manpages/qvm-features.rst

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ means :py:obj:`False` and non-empty string (commonly ``'1'``) means
5252
extension-dependent. In most cases the default value for feature is retrieved
5353
from a qube template.
5454

55+
Feature managed by the `system` must not be modified by users.
56+
5557
List of known features
5658
----------------------
5759

@@ -105,7 +107,7 @@ boot-mode.name.\*
105107

106108
The user-visible pretty name for a boot mode. The ID of the boot mode with the
107109
given pretty name is specified by the last dot-separated word in the feature
108-
key, while the pretty name is specified by the feature value.
110+
key, while the pretty name is specified by the feature value.
109111

110112
gui
111113
^^^
@@ -184,8 +186,10 @@ internal
184186

185187
Internal qubes (with this feature set to :py:obj:`True`) are not included in the
186188
menu, not available in GUI tools (e.g in Global Settings as a default net qube)
187-
and generally hidden from normal usage. It is not recommended to set this
188-
feature manually.
189+
and generally hidden from normal usage (including not showing as a Qrexec target
190+
for `Ask` rules. It is not recommended to set this feature manually. If this
191+
feature is set to a template, applications may consider qubes based on this
192+
template as internal also.
189193

190194
Default: not internal VM
191195

@@ -422,6 +426,71 @@ calls. Feature value could contain the rationale for the start ban.
422426
Note: `prohibit-start` for a TemplateVM does not forbid start of AppVMs based
423427
on it.
424428

429+
preload-dispvm-max
430+
^^^^^^^^^^^^^^^^^^
431+
432+
Number of disposables to preload. Upon setting, the number of running preloaded
433+
disposables will be adjusted to match the maximum configured, if there is not
434+
enough of them and there is enough available memory on the system, new ones will
435+
be created, if there are more than enough, the excess will be removed.
436+
437+
|
438+
| **Valid on**: disposable template
439+
| **Type**: `int`
440+
| **Default**: `0`
441+
442+
preload-dispvm
443+
^^^^^^^^^^^^^^
444+
445+
Space separated list of preloaded disposables originated from the disposable
446+
template. Preloaded disposables are disposables that run in the background
447+
waiting for use, specially designed for minimal waiting time to open
448+
applications in a fresh disposable.
449+
450+
Preloaded disposables have its GUI applications entries hidden and are paused to
451+
avoid user mistakes, as it is not intended to use them directly. To use them,
452+
target the disposable template to start a service in a disposable, instead of
453+
creating a new disposable, calls will be redirected to the first preloaded
454+
disposable in the list. As soon as the preloaded disposable is requested to be
455+
used, it is removed from the `preload-dispvm` list, GUI applications entries
456+
become visible, followed by a new disposable being preloaded.
457+
458+
.. warning::
459+
460+
Applications configured to autostart by the disposable template or the
461+
template itself will be interactive before the preloaded disposable can be
462+
paused.
463+
464+
|
465+
| **Managed by**: system
466+
| **Valid on**: disposable template
467+
| **Type**: `str`
468+
| **Default**: empty
469+
470+
preload-dispvm-request
471+
^^^^^^^^^^^^^^^^^^^^^^
472+
473+
If `True`, preloaded disposable has been requested for use and is running the
474+
procedures to mark it as used.
475+
476+
|
477+
| **Managed by**: system
478+
| **Valid on**: preloaded disposables
479+
| **Type**: `boolean`
480+
| **Default**: `False`
481+
482+
preload-dispvm-skip-interrupt
483+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
484+
485+
If `True`, preloaded disposable has been requested for use before it has been
486+
interrupted (pause/suspend), therefore it is allowed to skip them.
487+
488+
|
489+
| **Managed by**: system
490+
| **Valid on**: preloaded disposables
491+
| **Type**: `boolean`
492+
| **Default**: `False`
493+
425494
custom-persist.*
426495
^^^^^^^^^^^^^^^^
427496

qubesadmin/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,11 @@ def clone_vm(
500500
raise
501501

502502
for feature, value in src_vm.features.items():
503+
if (
504+
feature.startswith("preload-dispvm")
505+
and feature != "preload-dispvm-max"
506+
):
507+
continue
503508
try:
504509
dst_vm.features[feature] = value
505510
except qubesadmin.exc.QubesException as e:

0 commit comments

Comments
 (0)