storage: centralize shrinking check from qvm-volume to module#475
Conversation
The only method in admin.pool.volume.* that actually exists is List; everything else related to volumes lives in admin.vm.volume.*
Shrinking is already allowed by admin.vm.volume.Resize and implemented by file-reflink.
'extend' is already just a legacy alias for 'resize'. It looked odd to continue using the former name in the implementation, since it has been able to shrink volumes for a long time.
Ensure that other (e.g. GUI) callers of volume.resize() are also protected against shrinking, unless they opt into it by passing allow_shrink=True. If the safety check fails, the (slightly fleshed out) message still mentions 'qvm-volume resize --force' because this is the only tool featuring such an override.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #475 +/- ##
=======================================
Coverage 76.79% 76.79%
=======================================
Files 53 53
Lines 9402 9408 +6
=======================================
+ Hits 7220 7225 +5
- Misses 2182 2183 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
It only handles a single volume.
…ist) The only method in admin.pool.volume.* that actually exists is List; everything else related to volumes lives in admin.vm.volume.* Also remove the already commented out names in test_994_dom0_only_calls. There is a *non* commented out List as well, which is not removed. Equivalent cleanup on the client side is part of QubesOS/qubes-core-admin-client#475 (commit "tests/storage: remove phantom admin.pool.volume.* tests")
…ist) The only method in admin.pool.volume.* that actually exists is List; everything else related to volumes lives in admin.vm.volume.* Also remove the already commented out names in test_994_dom0_only_calls. There is a *non* commented out List as well, which is not removed. Equivalent cleanup on the client side is part of QubesOS/qubes-core-admin-client#475 (commit "tests/storage: remove phantom admin.pool.volume.* tests") (cherry picked from commit 519aa57)
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026072219-devel&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026050504-devel&flavor=update
Failed tests14 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/176874#dependencies 27 fixed
Unstable testsDetails
Performance TestsPerformance degradation:42 performance degradations
Remaining performance tests:69 tests
|
* origin/pr/835: storage/zfs: support shrinking volumes storage/lvm,file: support shrinking volumes Pull request description: Similar in purpose to #477, #478, #479 by @a-barinov in 2022, but with the shrinking check happening on the frontend side as [suggested](#477 (comment)) by @marmarek. The frontend already had such a check but only in the `qvm-volume` tool; QubesOS/qubes-core-admin-client#475 centralizes this check to `qubesadmin.storage.Volume.resize()` so that any other callers are protected as well. (Qube Manager's qube Settings dialog / `qubes-vm-settings` also has its own logic that avoids calling `resize()` if it would shrink.) Closes #479
No description provided.