Skip to content

Handle more events and deprecate Transient state#480

Draft
ben-grande wants to merge 4 commits into
QubesOS:mainfrom
ben-grande:transient
Draft

Handle more events and deprecate Transient state#480
ben-grande wants to merge 4 commits into
QubesOS:mainfrom
ben-grande:transient

Conversation

@ben-grande

@ben-grande ben-grande commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Draft as it was not tested at all.

Fixes: QubesOS/qubes-issues#10964
For: QubesOS/qubes-issues#10966

When checking libvirt event callbacks, VIR_DOMAIN_EVENT_STOPPED is the
only event called when shutting down or destroying/killing a domain, so
the state transitions from Running->Halted, therefore, never sending
"Halting" or "Dying".

I checked the clients, and only qubes-manager uses "Dying", but it has a
"Halting" equivalent, which all translate to the same visuals as
"Transient".
Variables set on the module level so it can be reused by other clients.
ben-grande added a commit to ben-grande/qubes-desktop-linux-manager that referenced this pull request Jul 15, 2026
Cache events to allow caching power state and avoid extra API calls.
With that, also trust the client to return us the appropriate power
state that it set on the event, instead of making derivative tools roll
their own state definition.

Fixes: QubesOS/qubes-issues#10977
Fixes: QubesOS/qubes-issues#10978
For: QubesOS/qubes-issues#10966
Requires: QubesOS/qubes-core-admin-client#480
ben-grande added a commit to ben-grande/qubes-desktop-linux-manager that referenced this pull request Jul 15, 2026
@ben-grande ben-grande linked an issue Jul 15, 2026 that may be closed by this pull request
ben-grande added a commit to ben-grande/qubes-desktop-linux-menu that referenced this pull request Jul 15, 2026
Cache events to allow caching power state and avoid extra API calls.
With that, also trust the client to return us the appropriate power
state that it set on the event, instead of making derivative tools roll
their own state definition.

Fixes: QubesOS/qubes-issues#10979
For: QubesOS/qubes-issues#10966
Requires: QubesOS/qubes-core-admin-client#480
ben-grande added a commit to ben-grande/qubes-desktop-linux-menu that referenced this pull request Jul 15, 2026
ben-grande added a commit to ben-grande/qubes-desktop-linux-manager that referenced this pull request Jul 15, 2026
Cache events to allow caching power state and avoid extra API calls.
With that, also trust the client to return us the appropriate power
state that it set on the event, instead of making derivative tools roll
their own state definition.

Fixes: QubesOS/qubes-issues#10977
Fixes: QubesOS/qubes-issues#10978
For: QubesOS/qubes-issues#10966
Requires: QubesOS/qubes-core-admin-client#480
ben-grande added a commit to ben-grande/qubes-desktop-linux-manager that referenced this pull request Jul 15, 2026
Besides the name "Transient" means impermanent, it could as well take a
long time in case the qrexec agent on the qube broke. Also it doesn't
help anything knowing that via the power state, it should be broadcasted
in another manner. It also doesn't tell the clients why it is in a
transient state, while "Starting" and "Halting" really does tell us what
is happening.

For: QubesOS/qubes-issues#10964
For: QubesOS/qubes-issues#10966
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.80%. Comparing base (b8a948d) to head (6434a87).

Files with missing lines Patch % Lines
qubesadmin/app.py 50.00% 6 Missing ⚠️
qubesadmin/tools/qvm_start_daemon.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
+ Coverage   76.79%   76.80%   +0.01%     
==========================================
  Files          53       53              
  Lines        9402     9412      +10     
==========================================
+ Hits         7220     7229       +9     
- Misses       2182     2183       +1     

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve handling of Transient power state API client that enables caching always sets the state after unpause to Running when it could be Transient

1 participant