Skip to content

Conversation

@alimirjamali
Copy link
Contributor

@alimirjamali alimirjamali commented Oct 3, 2025

@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.19%. Comparing base (2965dd1) to head (dca546d).

Files with missing lines Patch % Lines
qubesadmin/tools/qvm_restart.py 89.28% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #387      +/-   ##
==========================================
+ Coverage   76.16%   76.19%   +0.03%     
==========================================
  Files          53       54       +1     
  Lines        9245     9273      +28     
==========================================
+ Hits         7041     7066      +25     
- Misses       2204     2207       +3     

☔ 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.

running_vms = [
vm.name
for vm in args.domains
if vm.get_power_state() == "Running"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only Running? What if I want to have a command that ensures that certain qubes are either running or with the latest state:

  • debian: open the qube and do some changes
  • work: state: Halted, template: debian
  • personal: state: Running, template: debian

Hum, I will need to user work and personal now, let's make sure they are in their latest state:

qvm-shutdown --restart work personal

With the only running check, it would be a bit more longer:

qvm-shutdown --restart personal
qvm-start work

Copy link
Member

Choose a reason for hiding this comment

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

Honestly, it's rather weird to use qvm-shutdown tool to start a qube in your example...

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it should be qvm-start --restart instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why only Running?

To make qvm-shutdown --all --restart a possibility. To make it possible to restart all currently running qubes.

Maybe it should be qvm-start --restart instead?

After some feedback here and on Matrix channel, I believe a new dedicated qvm-restart tool is desirable.

@ArrayBolt3 and some other users had some good explanation on Matrix on why a dedicated tool is a good idea. I will amend this PR and come back.

Copy link
Contributor

Choose a reason for hiding this comment

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

To make qvm-shutdown --all --restart a possibility. To make it possible to restart all currently running qubes.

-Restart all running qubes is --all;

  • If --all is absent, shutdown and start or only start the specified qubes, being shutdown not enforced if the qube is Halted.

About other power states such as paused, I am not sure, possibly it shouldn't mess with those.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marmarek @ben-grande I rewrote a new dedicated qvm-restart tool among with manpage and unittests. I appreciate if you could review.

@alimirjamali alimirjamali marked this pull request as draft October 6, 2025 12:49
@alimirjamali alimirjamali force-pushed the qvm-shutdown-restart branch 2 times, most recently from 57d9023 to 1bfeb0c Compare October 7, 2025 14:41
@alimirjamali alimirjamali changed the title Add --restart to qvm-shutdown Add qvm-restart Oct 7, 2025
@alimirjamali alimirjamali marked this pull request as ready for review October 7, 2025 15:14

.. option:: --all

perform the action on all running qubes except dom0 & true DispVMs
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a better phrase than "true" DispVMs? Maybe "unnamed DispVMs" or "DispVMs with auto_cleanup enabled"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better phrase than "true" DispVMs? Maybe "unnamed DispVMs" or "DispVMs with auto_cleanup enabled"?

You are right. I agree with "unnamed DispVMs". I will amend the PR accordingly (I should also link the related Github issue).

@ben-grande

This comment was marked as off-topic.

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.

[feature request] qvm-restart

3 participants