-
-
Couldn't load subscription status.
- Fork 80
Add qvm-restart
#387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add qvm-restart
#387
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
qubesadmin/tools/qvm_shutdown.py
Outdated
| running_vms = [ | ||
| vm.name | ||
| for vm in args.domains | ||
| if vm.get_power_state() == "Running" |
There was a problem hiding this comment.
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 changeswork: state: Halted, template: debianpersonal: 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
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 --restartinstead?
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.
There was a problem hiding this comment.
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 --restarta possibility. To make it possible to restart all currently running qubes.
-Restart all running qubes is --all;
- If
--allis 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.
There was a problem hiding this comment.
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.
57d9023 to
1bfeb0c
Compare
doc/manpages/qvm-restart.rst
Outdated
|
|
||
| .. option:: --all | ||
|
|
||
| perform the action on all running qubes except dom0 & true DispVMs |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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_cleanupenabled"?
You are right. I agree with "unnamed DispVMs". I will amend the PR accordingly (I should also link the related Github issue).
1bfeb0c to
dca546d
Compare
fixes: QubesOS/qubes-issues#4747