pkg/machine: apply ro mount option to virtiofs and 9p shares #29898
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 331 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.347
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #29898"
general
weight: 0.35
Luap99
When mounting volumes in virtual machines (virtiofs on macOS/Linux or 9p on Windows Hyper-V), volume configurations containing the
:roflag were parsed intovmconfigs.MountwithReadOnly: true, but the read-only flag was omitted when configuring mounts in the guest. This caused guest VMs to mount the shares read-write.This change:
1. Adds
roto virtiofs systemd mount options inGenerateSystemDFilesForVirtiofsMountswhenmnt.ReadOnlyis true.2. Passes
--read-onlytoclient9pfor Windows Hyper-V 9p shares, adding,roto kernel 9p mount options.3. Preserves
OriginalInputacross volume mappings.4. Adds unit and machine e2e tests covering read-only virtiofs and 9p volume configurations.
Fixes: #29897
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
<!--
Write
Noneif there are no user-facing changes, otherwise enter your release note below.Include "action required" if users need to take action when upgrading.
-->
``
release-note
``Fix an issue where machine volumes configured as read-only (:ro) were mounted read-write in guest virtual machines for virtiofs and 9p shares.