block: Detect and open flat VMDK images

Adds support to detect and open flat vmdk images.
In particular, it updates the `detect_image_type` method to
account for unaligned & small sized descriptor file (which describes
the VMDK disk) reads using AlignedFile::read_at instead of
read_file_at to loop over for small reads.

Signed-off-by: Sumedh Alok Sharma <sumsharma@microsoft.com>
This commit is contained in:
Sumedh Alok Sharma
2026-07-13 10:27:47 +00:00
committed by Wei Liu
parent e6fd5fefc4
commit 82b65c3352
4 changed files with 61 additions and 4 deletions

View File

@@ -1597,6 +1597,7 @@ mod common_parallel {
ImageType::Qcow2 => ("qcow2", &[]),
ImageType::FixedVhd => ("vpc", &["-o", "subformat=fixed"]),
ImageType::Vhdx => ("vhdx", &[]),
ImageType::FlatVmdk => panic!("unsupported image_type {image_type}"),
ImageType::Unknown => panic!("unsupported image_type {image_type}"),
};
let image_type_str = image_type.to_string();