Repository navigation
Conversation
First step of loading a spawn from a VM image (multikernel#23). The decoder is pure Python and handles deflate and zstd compressed clusters and zero clusters. Backing files, encryption, external data files and extended L2 entries are rejected with a clear error, since none of them can be represented in the sparse raw output this produces. Signed-off-by: saeednourian82 <saeednourian82@gmail.com>
congwang-mk
reviewed
Dec 2, 2026
congwang-mk
reviewed
Dec 2, 2026
Raise Qcow2Error when a compressed cluster does not expand to exactly cluster_size, for both deflate and zstd, and add tests. Also update the copyright headers.
Refuse to convert an image onto itself, remove the output file when decoding fails, and ignore L1 entries that lie past the end of the disk.
Author
|
While fixing this I audited the rest of convert_to_raw for the same kind of silent failure and fixed three more: converting an image onto itself truncated the source, a failed conversion left a partial .raw behind, and L1 entries past the end of the disk were still validated. Each has a test that fails without the fix. Happy to split those into a separate PR if you prefer. |
congwang-mk
reviewed
Dec 2, 2026
A failed conversion no longer touches a pre-existing dest.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of #23: a standalone qcow2 -> raw decoder (src/kerf/qcow2.py). New files only, no change to existing code.
Testing:
qemu-img convert -O rawon images with plain, zeroed, zlib-compressed and zstd-compressed clusters (manual check, not part of the tests).