Skip to content
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

Enable restoring volumes with size smaller than default #215

Closed
wants to merge 1 commit into from

Conversation

a-barinov
Copy link

No description provided.

@a-barinov
Copy link
Author

This commit is harmless standalone as backend will not downsize volumes without additional commits.

@a-barinov a-barinov marked this pull request as ready for review May 21, 2022 19:27
@marmarek
Copy link
Member

Thanks for the contribution!
You need to update tests - see CI log at https://gitlab.com/QubesOS/qubes-core-admin-client/-/jobs/2488973220

@a-barinov
Copy link
Author

I miss he days when patches were submitted by email... Anyway, this PR needs to come in first, then I'll do a new PR for restore.py code change

@a-barinov a-barinov closed this May 28, 2022
@marmarek
Copy link
Member

Anyway, this PR needs to come in first,

This isn't strictly true. import_with_size() allows importing volume even if given size is smaller than current volume size - there is no need to call resize separately. What you need to do, is to adjust _handle_volume_size to save the size somewhere, to be used as import_with_size() argument, instead of calling resize. Alternatively, refactor _handle_volume_size and _handle_volume_data into one function with two parameters, and adjust all places where it is called.

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