-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add boot mode support #653
Conversation
6ad2b9c
to
4a98ef3
Compare
Most of the backend is now working, however see QubesOS/qubes-issues#9775, which blocks this from being fully functional. (EDIT: The linked bug report has been fixed by Marek, thus this is no longer blocked.) |
8a8dc7d
to
f8270e6
Compare
f8270e6
to
222d0ef
Compare
This is now ready for review. This should be merged at the same time as the corresponding frontend PR, QubesOS/qubes-manager#407. |
The first thing I see - this needs unit tests. See qubes/tests/ dir. You are most likely interested in ext.py and vm/qubes.py there. |
Yep, I figured those were probably necessary. I'm working on those now. |
222d0ef
to
2278612
Compare
Unit tests now added (and broken ones fixed). They may need to be enhanced though, not all of the new code is tested because I haven't figured out how to make the defaults mechanism work seamlessly in the mocks. Not sure if that's even possible, or desirable. |
and see also CI - both pylint and black complain |
Thanks for the very thorough review! Will work through these issues and then request another review once ready. |
@marmarek What would you think about me reorganizing the boot mode feature names from |
Fine with me. |
bc4c000
to
3d15788
Compare
Still need to deal with pylint and black issues, the ext unit tests, and look at the default boot mode name stuff a bit more. Pushed what I had so far since it resolved most issues. |
3d15788
to
6041b90
Compare
This should now be ready for another review. I still haven't figured out the default boot mode name stuff, but everything else should now be dealt with. |
hint: |
@marmarek The problem I'm running into with trying to add a default boot mode name is that in qubes-builderv2, |
d1c6e0f
to
975b945
Compare
Did another push because black had to reformat some things. |
pylint complains... |
975b945
to
c063813
Compare
Fighting with event handler regression test issues, not ready for review yet... |
c063813
to
a6b1df5
Compare
@marmarek I tried to fix the pylint issues, which seems to have made it happy, but the regression tests now fail:
I can't figure out why this happens though -
This is nearly identical to a signature in
How come the second one works but the first one doesn't? (The first one used to work without problems before adding |
self is vm, don't need to repeat it. It's the difference between event handler defined in the VM class itself ( |
Oh sheesh. I stared at this code for like fifteen minutes and didn't notice the |
a6b1df5
to
eef6ece
Compare
Fixed the issue with the failing regression tests. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #653 +/- ##
==========================================
+ Coverage 69.90% 70.07% +0.16%
==========================================
Files 59 59
Lines 12612 12683 +71
==========================================
+ Hits 8817 8888 +71
Misses 3795 3795
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@marmarek How would I run the code coverage test locally? It looks like there's some missed stuff I would have liked to have caught on my end earlier. Currently working on resolving that now. |
The run-tests scripts does run with code coverage enabled. You can get the report with |
eef6ece
to
1ce1cdb
Compare
qubesvm.py line 1010 should be unreachable code, thus why it shows as not covered. ( |
Black complains about one tiny thing... |
Boot modes provide a way for VMs to advertise that they can have their behavior changed by booting them with a predefined combination of additional kernel parameters set. This allows qubes to offer features like a secure system maintenance mode in a way that works seemlessly with Qubes OS. This commit adds boot mode support to qubes-core-admin, providing API support for boot modes and allowing VMs to be booted with special kernel parameters specified by boot modes.
1ce1cdb
to
e9c62be
Compare
Should be fixed, I'll try to get in the habit of running it before all pushes. (aside, qubes-manager is NOT formatted by black, and I've caused myself major headaches more than once thinking I'm supposed to reformat it after changing it and then realizing I just changed like 90% of the code in a way that's tricky to revert if you had uncommitted, unstaged changes, or were silly enough to run |
It isn't yet |
* origin/pr/666: Keep AppVM boot modes and template AppVM default boot mode in sync Pull request description: Qube Manager was showing the wrong boot mode kernel options for AppVMs if you changed a template's AppVM default boot mode. Issue had a similar root cause to #653 (comment). This PR fixes it.
This PR is intended to add support for boot modes as specified here: QubesOS/qubes-issues#9750 (comment) This naturally only handles the backend part of things, the frontend will need its own PR against qubes-manager.
This is incomplete - I have not yet actually added the part that listens for qvm-request-features calls from TemplateVMs and sets boot mode features appropriately.
This implements (or rather, will implement) the backend component needed to implement QubesOS/qubes-issues#9750.