block: vhd: impl Resizable for FixedVhdDiskAsync

Fixed VHD does not support resize, return UnsupportedFeature.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-03-24 17:10:08 +01:00
committed by Bo Chen
parent 0dece29fa8
commit df5d2d64b2

View File

@@ -78,6 +78,16 @@ impl disk_file::Geometry for FixedVhdDiskAsync {}
impl disk_file::SparseCapable for FixedVhdDiskAsync {}
impl disk_file::Resizable for FixedVhdDiskAsync {
fn resize(&mut self, _size: u64) -> BlockResult<()> {
Err(BlockError::new(
BlockErrorKind::UnsupportedFeature,
DiskFileError::ResizeError(std::io::Error::other("resize not supported for fixed VHD")),
)
.with_op(ErrorOp::Resize))
}
}
pub struct FixedVhdAsync {
raw_file_async: RawFileAsync,
size: u64,