qvm-device: add --force flag for dom0 device attachment#466
Conversation
|
It should also be documented. |
Thanks @parulin. The introduction of this change is still in discussion. Would of course document it. |
|
The build fails because of missing man page entry: |
|
When invoked without |
|
About the use of |
|
Also, next time, don't use your main branch, create a separate branch for making commits. Now, if you force push to base on a different branch, I think Github will force close this PR, so keep as is. |
|
Please add "Fixes: QubesOS/qubes-issues#10825" to the commit message. |
|
@ben-grande commit message or PR description or both? |
|
Both is better. |
|
@parulin @marmarek @rustybird |
|
Please squash the commits. |
|
There is a merge commit. To squash, I normally do |
|
all good now |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #466 +/- ##
==========================================
+ Coverage 76.82% 76.86% +0.03%
==========================================
Files 53 53
Lines 9361 9374 +13
==========================================
+ Hits 7192 7205 +13
Misses 2169 2169 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| elif vm.klass == 'AdminVM': | ||
| print('Attaching a device to dom0 can be a security risk ', | ||
| file=sys.stderr) | ||
| try: |
There was a problem hiding this comment.
- I think you can make this try block less repetitive.
- Please add appropriate test
- In the case of
EOFError, it should not exit 0.
…ive confirmation Add --force/-f flag to skip the interactive confirmation prompt when attaching a device to dom0. Without this flag, attaching to dom0 will interactively ask for confirmation, matching the pattern used by qvm-volume clear and qvm-remove. Includes manpage documentation and test coverage. Fixes: QubesOS/qubes-issues#10825
Attaching a device directly to dom0 carries security risks, so the tool now requires explicit user confirmation when the target is an AdminVM(dom0).
A new
--force/-fflag bypasses the interactive prompt for scripted or automated use.The confirmation reads from stdin and treats EOF (closed/piped stdin) as a cancellation, preventing silent attachments in non-interactive contexts.
fixes: QubesOS/qubes-issues#10825
related: QubesOS/qubes-core-admin#798