add qvm-restart#470
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #470 +/- ##
==========================================
+ Coverage 76.83% 76.85% +0.01%
==========================================
Files 53 54 +1
Lines 9365 9399 +34
==========================================
+ Hits 7196 7224 +28
- Misses 2169 2175 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
That should address the issues that are obvious-ish for me to fix. Only thing left is the qvm-start issue. @marmarek it seems to me Am I missing something? |
There is a bunch of cases where qvm-start can fail. Startup timeout, not enough memory, not enough disk space, and many more. BTW #469 does refactor to make at least shutdown function reusable. You might want to wait for it to be merged, and then use the new function. |
Shouldn't it get caught here?: It returns status after the loop ends, so all start-able domains should start. They definitely do when I try a group with some of them having far too much memory to start. |
|
Right, this case might be okay. But still, invoking other tool's main from another tool, parsing arguments again etc is not a good idea. This will also create several instances of |
What's wrong with that? If anything using the same
Okay, should I create a separate pr for that, similar to Ben's |
No need for a separate PR, unless Github auto-closes this one when you rebase to a different upstream branch, and doesn't allow anyone to reopen it...
|
| ) | ||
| ) | ||
| if failed['start']: | ||
| sys.stderr.write("Failed to start domains back up:\n") |
There was a problem hiding this comment.
See parser.print_error.
There was a problem hiding this comment.
Wow that method looks useless, and requires making parser available. Why does it exist?
Regardless, I can't use it if I want to have output without "Error:" in each print. Adopted for pre-report messages.
46d45b5 to
626ae1f
Compare
|
Pylint is complaining that test lines too long, when broken apart they're less readable. |
- Use utils for starts and shutdowns - Allow restart of non-dom0 AdminVMs - Easily parseable failure reporting - Restart running domains only by default; "start" flag if user wants to start initially halted domains - Reflect the fact `--all` doesn't put `dom0` into `args.domains` - Always return error code if start/shutdown calls fail - Optional `--force` - Update man page - Add short options
|
Seems like |
Use |
| if not args.start: | ||
| target_domains = [ | ||
| vm for vm in target_domains | ||
| if vm.get_power_state() == "Running" |
There was a problem hiding this comment.
Change this to if vm.is_running()?
|
I have a use case for this to be in "utils" module (without expecting a command-line client), so I can easily use here (see how other actions were done): |
An attempt to finalize Ali's work: #387
Closes QubesOS/qubes-issues#4747
I have decided to not handle shutdown in situ because I would like to avoid duplication