-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Function "reset_private_image" in qvm_template_postprocess fails with "not enough data" #5946
Function "reset_private_image" in qvm_template_postprocess fails with "not enough data" #5946
Comments
No, this error check was introduced specifically to avoid treating truncated input (including 0) as a valid data - in most cases truncated input means something gone wrong on the sending side.
Yes, that should work. There is a call |
Are you trying it on R4.1 or R4.0? On R4.1 there is a |
Just to be clear: do not try to resize down to 0 manually. Try to import zero-sized content, using |
Indeed, I originally attempted to do this manually. (Soon realized what you meant and removed the previous comment.) I'll try this out and create a PR later. |
Calling Poked around a bit and it seemed that this was due to https://github.com/QubesOS/qubes-core-admin/blob/master/qubes/api/internal.py#L101 requiring the size to be greater than zero. Even when that line is removed, the underlying Using something like the following works, but feels pretty hackish.
|
Hmm, in this case perhaps the best way is to introduce new call like |
Requires QubesOS/qubes-issues#5946 to be resolved.
B |
My understanding from reading the source code is that this happens automatically as long as I reuse the import mechanism internally, so hopefully, not much extra work needs to be done for this. |
* origin/pr/359: Add tests for vm.volume.Clear. Use self.dest.storage.import* wrappers instead. Add admin.vm.volume.Clear call (QubesOS/qubes-issues#5946)
* origin/pr/149: Add admin.vm.volume.Clear call (QubesOS/qubes-issues#5946)
Requires QubesOS/qubes-issues#5946 to be resolved.
Qubes OS version
R4.1
Affected component(s) or functionality
qvm-template-postprocess
Brief summary
reset_private_img
raises the following error:To Reproduce
Reinstall an already-installed template RPM.
Expected behavior
Private volume is cleared.
Actual behavior
The aforementioned error occurs.
Additional context
Ran into this issue while testing the the {reinstall,{down,up}grade} operations of
qvm-template
(QubesOS/qubes-core-admin-client#145).Upon further inspection, it seems that the
admin.vm.volume.Import
call requires the payload stream to be of the same size as the volume, causing the error. (Commit that introduced the check: QubesOS/qubes-core-admin@e9b97e4)Solutions you've tried
I tried replacing the import call with resizing the volume to zero then back to the old size. However, the relevant qrexec call does not seem to support the shrinking of volumes.
It seems sufficient to simply treat an input length of zero as a special case in
admin.vm.volume.Import
, though I am not sure if this is an ideal solution.Relevant documentation you've consulted
Related, non-duplicate issues
None.
The text was updated successfully, but these errors were encountered: