Skip to content

Conversation

ben-grande
Copy link

@ben-grande ben-grande commented May 22, 2025

@ben-grande
Copy link
Author

The current behavior of preloaded disposables when changing default_dispvm needs to be defined.

  1. Do not mess with the old default_dispvm preload-dispvm-max feature and set the new default_dispvm feature to the same as per the old one.
  2. Set old default_dispvm preload-dispvm-max feature to 0 and set the new default_dispvm feature to the same as per the old one.
    1. Marek recommended a dom0 feature default-dispvm-preload-max. I'd say that such feature must take precedence over the disposable template feature for the GUI to behave as expected by the user.

I am concerned option 1 as a user that only uses Global Config and not Qube Settings will have lingering qubes.

Option 2 seems more sane, but I don't like the last part of my proposition:

set the new default_dispvm feature to the same as per the old one

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 preload-dispvm-max set to a number different than the default_dispvm feature, we would be modifying the value set by the user elsewhere (vm settings, qvm-features or API) to the value received from the default_dispvm, I don't think this part makes sense.

And after writing what the new value should behave like, makes me think that the old value should not be changed to 0, because the user may have set the value elsewhere.

Then, I think the default-disvpm-preload-max dom0 feature makes sense, it would avoid this problems. With this feature, I'd say that the best behavior would be:

  1. If the disposable template is the default_dispvm, than it must respect default-disvpm-preload-max.
  2. When changing default_dispvm:
    1. The old default_dispvm will have the preload event start triggered to adapt to only having the feature preload-dispvm-max
    2. The new default_dispvm will have the value the user sets for it at runtime without depending on the old default_dispvm feature value.

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 default-dispvm-preload-max.

I guess it will be easier to grasp the advantages and disadvantages when coding. Any takes?

@ben-grande ben-grande force-pushed the preload-dispvm branch 7 times, most recently from 6831449 to 41e9f2a Compare June 3, 2025 15:02
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

❌ Patch coverage is 98.71795% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.99%. Comparing base (3a85bee) to head (26cdf14).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
qubes_config/global_config/basics_handler.py 97.18% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ben-grande added a commit to ben-grande/qubes-core-admin-client that referenced this pull request Jun 3, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 4, 2025
ben-grande added a commit to ben-grande/qubes-core-admin-client that referenced this pull request Jun 4, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 4, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 5, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 5, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 6, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 6, 2025
@ben-grande ben-grande changed the title [WIP] Add preload disposable setting to global config Add preload disposable setting to global config Jun 6, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 6, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 6, 2025
ben-grande added a commit to ben-grande/qubes-core-admin that referenced this pull request Jun 7, 2025
<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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like, "Queues disposables in the background so they're available immediately, but each one uses memory."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍

@marmarta
Copy link
Member

But from user POV this is startup time: time between "I asked for a dispvm" and "I've received a dispvm".

@marmarek
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but this will change explicit 0 into 1, no?

@ben-grande
Copy link
Author

ben-grande commented Jul 23, 2025 via email

@ben-grande
Copy link
Author

PipelineRetryFailed

2 similar comments
@ben-grande
Copy link
Author

PipelineRetryFailed

@ben-grande
Copy link
Author

PipelineRetryFailed

@ben-grande ben-grande requested a review from marmarek July 24, 2025 12:58
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
@ben-grande
Copy link
Author

Finally :) !

@marmarek marmarek merged commit 8edd811 into QubesOS:main Jul 30, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants