cloud-hypervisor/block
Anatol Belski 3fed706d6a block: qcow: Fix v3 header writing and add extension tests
The write_to() function is used by test code to create qcow2 files for
testing. For v3 headers with extended header_size (>104), it needs to:

1. Write the mandatory compression_type field at bytes 104-111
2. Write the header extension end marker at the header_size offset
3. Seek to backing_file_offset before writing the backing file path

Additionally, create_for_size_and_path() must set backing_file_offset
to account for the 8 byte extension end marker in v3 files, so the
backing file path doesn't overwrite the extension area.

Add unit tests for read_header_extensions() covering backing format
parsing (raw/qcow2), unknown extensions, and error cases (invalid
formats, invalid UTF-8). These tests depend on the header writing fixes
to create properly formatted v3 test files.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-01-15 16:19:15 +00:00
..
src block: qcow: Fix v3 header writing and add extension tests 2026-01-15 16:19:15 +00:00
Cargo.toml build: Bump the non-rust-vmm group across 2 directories with 14 updates 2026-01-13 05:09:15 +00:00