-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Allow volume shrinking #479
base: master
Are you sure you want to change the base?
Conversation
Bypass size check for file and lvm if shrinking is allowed. Implement size check for reflink as it wasn't there.
Codecov Report
@@ Coverage Diff @@
## master #479 +/- ##
==========================================
- Coverage 65.82% 65.78% -0.04%
==========================================
Files 53 53
Lines 10015 10015
==========================================
- Hits 6592 6588 -4
- Misses 3423 3427 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This PR should not change anything in how volumes are currently resized. An the next step, patch to allow volume when restoring from backup will be submitted. I see Codecov complaining about reduced coverage, let me know if this needs to be dealt with before PR is accepted. |
A test for new resize parameter would be useful. See qubes/tests/storage_lvm.py for example - you can add something based on test_006_resize that attempt to shrink the volume (either with allow_shrink=True and False - and check for expected outcome). |
Is the storage driver API really the right place to distinguish between extending and resizing? Duplicating this safety check in each driver looks strange to me. Why not something like:
|
I'm a bit worried about this step - if you update core-admin but not core-admin-client, then you'll end up without the safety check at all. In dom0, a package dependency could be used to avoid this, but not in sys-gui. Maybe sys-gui is still rare enough to not care about it right now... ? |
I hadn't thought of that... @a-barinov's approach of having the safety check in the storage driver might be the way to go then. That also avoids introducing a TOCTOU problem if there are concurrent API calls. (Is there something ReflinkVolume and FileVolume could use to enforce |
Tried doing this, but can't find a way to re-run CI test to check if the tests I added do make sense / do not fail. Deleting this PR and creating a new one does not sound like a good solution. |
We're doing some maintenance on CI, should be back online in few hours. |
PipelineRetry |
This looks good as is, but there needs to be further change to actually use the new parameter (expose it in api/admin.py, and then add support in qvm-volume tool). The backup case is handled by |
Change Volume.resize call to allow volume shrinking.
Bypass size check for file and lvm if shrinking is allowed.
Implement size check for reflink as it wasn't there.