Add preload disposable setting to global config#262
Conversation
8036850 to
34e4962
Compare
|
The current behavior of preloaded disposables when changing
I am concerned option Option
I prefer the current behavior, which is, when toggling between disposable templates, it fetches the current feature value so you can see it updating at runtime. If we consider that the selected disposable template that is being set already has And after writing what the new value should behave like, makes me think that the old value should not be changed to Then, I think the
Or I make fetching current value code less dynamic from the current disposable template selected and enforce that it only reads and set the dom0 feature I guess it will be easier to grasp the advantages and disadvantages when coding. Any takes? |
34e4962 to
8331269
Compare
6831449 to
41e9f2a
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #262 +/- ##
==========================================
- Coverage 92.99% 92.99% -0.01%
==========================================
Files 64 64
Lines 13034 13217 +183
==========================================
+ Hits 12121 12291 +170
- Misses 913 926 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9756c12 to
7e2be8b
Compare
It's the ALL_KNOWN_FEATURES global in mock_app.py |
|
Depends on QubesOS/qubes-core-admin-client#369. Codecov/patch should be 100%, excluding the |
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">Number of disposable qubes to preload from the default disposable template. The feature is deleted if the value is 0.</property> |
There was a problem hiding this comment.
But now it lost the info it overrides template's own value...
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">Number of disposable qubes to preload from the default disposable template. Takes precedence over the qube feature. The feature is deleted if the value is 0.</property> |
There was a problem hiding this comment.
I don't think this works. If someone set the feature manually (using qvm-features to 0), you'll get a super confusing situation where either pressing ok in config without changing anything will erase the feature or you can get 0 in two ways, one of which means something completely different from the other. If we want to have the possibility of turning this off, I think there should be a checkbox before this signifying if the feature exists or not.
There was a problem hiding this comment.
I don't think this works. If someone set the feature manually (using
qvm-featuresto 0), you'll get a super confusing situation where either pressing ok in config without changing anything will erase the feature or you can get 0 in two ways, one of which means something completely different from the other. If we want to have the possibility of turning this off, I think there should be a checkbox before this signifying if the feature exists or not.
Setting to 0 or '' (empty) will make the feature be deleted when saving, yes. I thought it was better this way because the global setting is an override of the local setting. I can make the feature not be deleted if the value isn't the same... but yeah, will require a checkbox to make it understandable. The scope was set on #262 (comment)
About having the possibility to turn this off..., I don't known when it is useful to turn this off, can you give an example?
There was a problem hiding this comment.
It's useful to have the disposable template's own value respected again - if you have multiple disposable templates you use (for example for different purposes) it's confusing to have one of them configured in a different place.
There was a problem hiding this comment.
Hm, it might be also useful to add info in qube setting of default disposable template if its own value is overridden...
There was a problem hiding this comment.
Hm, it might be also useful to add info in qube setting of default disposable template if its own value is overridden...
There was a problem hiding this comment.
Setting to
0or''(empty) will make the feature be deleted when saving, yes. I thought it was better this way because the global setting is an override of the local setting. I can make the feature not be deleted if the value isn't the same... but yeah, will require a checkbox to make it understandable. The scope was set on #262 (comment)About having the possibility to turn this off..., I don't known when it is useful to turn this off, can you give an example?
My issue is that: if the user sets the feature to 0 with qvm-features in dom0 CLI, and opens global config, with your proposal it will look the same as if the user deleted the feature.... but those two situations can lead to vastly different system behavior (if the feature is 0, no preloaded dispvms from default dvm template will be created, if it's deleted, the feature from the template will be used, which might be any number). Thus, using 0 as a magic value here is very confusing, and can lead to unpredictable behavior; as it's a feature so it might not be set, I think that having a checkbox (representing if the feature is set or not) and a value is the best way to display this sort of config.
There was a problem hiding this comment.
The checkbox cannot be before the text because it will mess up the indentation compared to the other items. Do you prefer the checkbox before or after the spin button?
|
Ready, besides the indentation... |
|
Reminder to self, when the text and no limit of this GUI is accepted, adapt on |
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">Start in the background up to the given number of disposable qubes based on the default disposable template. This makes request for disposable qubes faster at the expense of consuming RAM. Will only preload as much as your system can handle. Takes precedence over the qube feature as long as the box is checked.</property> |
There was a problem hiding this comment.
Not sure if I completely understand the context in which this will appear, but here's my suggested revision:
The maximum number of disposables that can be loaded in the background. This makes starting new disposables much faster, but each preloaded disposable will consume memory. Even if you set this number very high, Qubes OS will only ever preload as many disposables as your system can handle, so the actual number of preloaded disposables may be lower. When this setting is enabled, it takes precedence over the qube feature. All preloaded disposables will be based on the default disposable template.
What is "the qube feature"?
There was a problem hiding this comment.
What is the relationship between this and QubesOS/qubes-issues#1512 (comment)?
It is a literal qube feature, as set or shown by
qvm-features.
Hmm... Okay, in that case, here's a slight tweak:
The maximum number of disposables that can be loaded in the background. This makes starting new disposables much faster, but each preloaded disposable will consume memory. Even if you set this number very high, Qubes OS will only ever preload as many disposables as your system can handle, so the actual number of preloaded disposables may be lower. All preloaded disposables will be based on the default disposable template. When this setting is enabled, it takes precedence over the
qvm-featurespreloaded disposable setting.
There was a problem hiding this comment.
What is the relationship between this and QubesOS/qubes-issues#1512 (comment)?
That is just an idea for future releases, it wasn't coded, it was drawed and probably won't be done too soon. This version is an MVP.
Thanks for the text revision! I will work with that.
There was a problem hiding this comment.
I changed the text a bit. Didn't mention qvm-features because I think it complicates for the GUI user, they don't know what qube features are so I just wrote setting.
There was a problem hiding this comment.
I changed the text a bit. Didn't mention
qvm-featuresbecause I think it complicates for the GUI user, they don't know what qube features are so I just wrotesetting.
Not sure if it helps to clarify, but perhaps something like, "When this global setting is enabled, it takes precedence over every individual qube's specific preloaded disposable setting, if any."
But now that I think about it, shouldn't it be the other way around? (I.e., shouldn't a a more specific setting take precedence over a more general one?)
There was a problem hiding this comment.
I changed the text a bit. Didn't mention
qvm-featuresbecause I think it complicates for the GUI user, they don't know what qube features are so I just wrotesetting.Not sure if it helps to clarify, but perhaps something like, "When this global setting is enabled, it takes precedence over every individual qube's specific preloaded disposable setting, if any."
It only takes precedence over the disposable template.
But now that I think about it, shouldn't it be the other way around? (I.e., shouldn't a a more specific setting take precedence over a more general one?)
Normally, yes, but this global setting is not for every qube, is just for the qube that is the default_dispvm.
There was a problem hiding this comment.
It only takes precedence over the disposable template.
Okay, then how about: "When this global setting is enabled, it takes precedence over the default disposable template's own preloaded disposable setting."
Normally, yes, but this global setting is not for every qube, is just for the qube that is the
default_dispvm.
Okay.
|
PipelineRetry |
|
PipelineRetryFailed |
| <property name="margin-start">5</property> | ||
| <property name="margin-bottom">5</property> | ||
| <property name="has-entry">True</property> | ||
| <child internal-child="entry"> |
There was a problem hiding this comment.
Removed, no idea if I misclicked this on glade...
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">Preload disposables:</property> |
There was a problem hiding this comment.
Do we want "Preload disposables", or maybe more explicitly "Preload disposable qubes"?
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">The maximum number of disposables that can be loaded in the background. This makes using new disposables much faster, but each preloaded disposable will consume memory. Even if you set this number very high, Qubes OS will only ever preload as many disposables as your system can handle, so the actual number of preloaded disposables may be lower. The preloaded disposables will be based on the default disposable template. When this setting is enabled, it takes precedence over the default disposable template's own preloaded disposable setting.</property> |
There was a problem hiding this comment.
| <property name="label" translatable="yes">The maximum number of disposables that can be loaded in the background. This makes using new disposables much faster, but each preloaded disposable will consume memory. Even if you set this number very high, Qubes OS will only ever preload as many disposables as your system can handle, so the actual number of preloaded disposables may be lower. The preloaded disposables will be based on the default disposable template. When this setting is enabled, it takes precedence over the default disposable template's own preloaded disposable setting.</property> | |
| <property name="label" translatable="yes">Maximum number of disposable qubes (based on default disposable template) that will be created in the background, waiting until they are needed. This improves disposable qube startup time at the cost of increased memory usage. The setting here takes precedence over individual settings of the default disposable template. </property> |
This is really, really too long. I don't think the details about RAM usage are sensible here? If you think they are, please edit it down to one sentence about resource usage max.
There was a problem hiding this comment.
Used you version and cut it a bit also.
There was a problem hiding this comment.
As a Qubes user, I wouldn't know what The setting here takes precedence over individual settings of the default disposable template. means. "Which settings?" is what I'd be wondering.
There was a problem hiding this comment.
The same setting (preload) that is available to be changed via qubes-vm-settings?
This settings takes precedence over the default disposable template's preload setting.
Is this better?
There was a problem hiding this comment.
The same setting (preload) that is available to be changed via
qubes-vm-settings?This settings takes precedence over the default disposable template's preload setting.
Is this better?
Yes, but it sounds like the first "setting" should be singular.
| <object class="GtkLabel"> | ||
| <property name="visible">True</property> | ||
| <property name="can-focus">False</property> | ||
| <property name="label" translatable="yes">Maximum number of disposable qubes (based on default disposable template) that will be loaded in the background. This removes fresh disposable qube startup time at the cost of increased memory usage. The setting here takes precedence over the default disposable template's individual settings.</property> |
There was a problem hiding this comment.
I don't love the sentence "This removes fresh disposable qube startup time at the cost of increased memory usage"; I think that we do not use the "fresh disposable qube startup time" anywhere in the docs, so it might be somewhat confusing. "This speeds up disposable qube startup at the cost of memory."?
There was a problem hiding this comment.
"This speeds up disposable qube startup at the cost of memory."?
But it doesn't speed up startup time, the startup time remains the same. What it does, when requested, on the best case scenario (requesting after preload procedures have completed), is that it skips startup time.
Changed it to:
Reduces disposable qube use waiting time at the cost of increased memory usage.
What do you think? Used a similar phrase from the manual: https://github.com/QubesOS/qubes-core-admin-client/blob/68b2b3250c87ee18ed0e28b1b8e208e501d0faa9/doc/manpages/qvm-features.rst?plain=1#L450
There was a problem hiding this comment.
How about something like, "Queues disposables in the background so they're available immediately, but each one uses memory."
There was a problem hiding this comment.
What do you think:
Maximum number of disposable qubes (based on default disposable template) to queue in the background so they are available immediately, but each one reserves memory. This setting takes precedence over the default disposable template's individual settings.
There was a problem hiding this comment.
Suggested rewording:
The maximum number of disposable qubes to queue in the background. Preloaded disposables start instantly, but each one uses memory while queued. Preloaded disposables are always based on the default disposable template. This setting takes precedence over the default disposable template's preload setting.
If you need to make it shorter, I suggest dropping the last 1-2 sentences or moving them into a nearby "?" or "i" icon tooltip.
There was a problem hiding this comment.
Current text:
Maximum number of disposable qubes (based on default disposable template) to queue in the background so they are available immediately, but each one reserves memory. This setting takes precedence over the default disposable template's preload setting.
There was a problem hiding this comment.
IMHO, the first sentence is awkward, because the clause after the "but" doesn't contrast with the entire clause before the "but." Also, "Maximum number of disposable qubes (based on default disposable template)" is ambiguous, since it could be interpreted to mean that the maximum number is somehow based on the default disposable template.
There was a problem hiding this comment.
What do you think:
Maximum number of disposable qubes (created from the default disposable template) to queue in the background. They are available immediately, but each one reserves memory. This setting takes precedence over the default disposable template's preload setting.
|
But from user POV this is startup time: time between "I asked for a dispvm" and "I've received a dispvm". |
|
When you enable preload, can you make the default to "1"? To save one click when enabling the feature. |
| defdispvm = self.defdispvm_model.get_selected() | ||
| preloadcheck = self.preload_dispvm_check.get_active() | ||
| if defdispvm and preloadcheck: | ||
| self.preload_dispvm_spin.set_value(self.get_current_value() or 1) |
There was a problem hiding this comment.
Hm, but this will change explicit 0 into 1, no?
|
Yes, I see how it is wrong now...
…On Wed, Jul 23, 2025, 11:35 PM Marek Marczykowski-Górecki < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In qubes_config/global_config/basics_handler.py
<#262 (comment)>
:
> + )
+
+ def on_defdispvm_changed(self):
+ defdispvm = self.defdispvm_model.get_selected()
+ if defdispvm:
+ self.preload_dispvm_check.set_sensitive(True)
+ self.preload_dispvm_check.set_active(self.get_feat_value() is not None)
+ else:
+ self.preload_dispvm_check.set_sensitive(False)
+ self.preload_dispvm_check.set_active(False)
+
+ def on_check_changed(self, *args): # pylint: disable=unused-argument
+ defdispvm = self.defdispvm_model.get_selected()
+ preloadcheck = self.preload_dispvm_check.get_active()
+ if defdispvm and preloadcheck:
+ self.preload_dispvm_spin.set_value(self.get_current_value() or 1)
Hm, but this will change explicit 0 into 1, no?
—
Reply to this email directly, view it on GitHub
<#262 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCE2O4O2TXXSWBJQZYCXE2T3J75Z3AVCNFSM6AAAAAB5WNPV52VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTANBZGEZDMMZVGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
|
PipelineRetryFailed |
2 similar comments
|
PipelineRetryFailed |
|
PipelineRetryFailed |
Other disposables may be starting and those notifications may cause confusion as to why the user is seeing a disposable with a different name than what was recently shown in a notification. For: QubesOS/qubes-issues#1512
|
Finally :) ! |


For: QubesOS/qubes-issues#1512