Skip to content

Add support for default standalone boot modes#813

Open
ArrayBolt3 wants to merge 1 commit into
QubesOS:mainfrom
ArrayBolt3:arraybolt3/standalone-default
Open

Add support for default standalone boot modes#813
ArrayBolt3 wants to merge 1 commit into
QubesOS:mainfrom
ArrayBolt3:arraybolt3/standalone-default

Conversation

@ArrayBolt3
Copy link
Copy Markdown
Contributor

When a standalone is cloned from a template, the usual default boot mode of the standalone is the same as the boot mode the template originally used. In some instances this is undesirable; Kicksecure for instance puts its templates into a "sysmaint" boot mode that impairs standalone functionality.

To fix this, add a new qvm-feature, "boot-mode.standalone-default", which states which boot mode a standalone should be switched to when its root volume is cloned from any other VM. (Note that cloning a standalone from another standalone will switch it to the boot mode specified by "boot-mode.standalone-default", cloning a template isn't the only way to trigger this.)

Allows fixing QubesOS/qubes-issues#10514, but does not fix this bug by itself.

I've tested the main code of this on my R4.3 machine, and it seems to work. The test code is untested though, and I'd be surprised if the integration tests are actually correct as-is. Note also that I only implemented integration tests for the actual "change boot mode on root volume clone" part of this, since I couldn't figure out how to sanely implement normal tests. Thus coverage.py will probably be unhappy with this.

@ArrayBolt3 ArrayBolt3 force-pushed the arraybolt3/standalone-default branch from 202d550 to 6b4621c Compare May 28, 2026 02:48
@marmarek
Copy link
Copy Markdown
Member

Tests are missing lines like this in expected calls: "features.__contains__", ('boot-mode.kernelopts.new-mode', ), {}

When a standalone is cloned from a template, the usual default boot
mode of the standalone is the same as the boot mode the template
originally used. In some instances this is undesirable; Kicksecure for
instance puts its templates into a "sysmaint" boot mode that impairs
standalone functionality.

To fix this, add a new qvm-feature, "boot-mode.standalone-default",
which states which boot mode a standalone should be switched to when
its root volume is cloned from any other VM. (Note that cloning a
standalone from another standalone will switch it to the boot mode
specified by "boot-mode.standalone-default", cloning a template isn't
the only way to trigger this.)

Allows fixing QubesOS/qubes-issues#10514, but
does not fix this bug by itself.
@ArrayBolt3 ArrayBolt3 force-pushed the arraybolt3/standalone-default branch from 6b4621c to 409754f Compare May 29, 2026 01:35
@ArrayBolt3
Copy link
Copy Markdown
Contributor Author

Fixed. (I noticed the tests failed earlier today and was planning on getting to this, but then forgot, so thank you for the ping :) )

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.42%. Comparing base (b4626b6) to head (409754f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
qubes/vm/standalonevm.py 20.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #813      +/-   ##
==========================================
- Coverage   70.47%   70.42%   -0.05%     
==========================================
  Files          61       61              
  Lines       14139    14156      +17     
==========================================
+ Hits         9964     9969       +5     
- Misses       4175     4187      +12     
Flag Coverage Δ
unittests 70.42% <55.55%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@ArrayBolt3
Copy link
Copy Markdown
Contributor Author

ArrayBolt3 commented May 29, 2026

Looking at the codecov output, it makes me realize the integration tests I created aren't really comprehensive (they make sure that a normal boot mode transition works, but don't test what happens if the transition isn't possible or what happens when trying to transition to the "default" mode). It's probably worth testing those edge cases too. I can add those tests once I have confirmation that the existing tests look right.

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.

2 participants