mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: vhd: Remove catch all in physical_size boundary
FixedVhd::physical_size() can only return Error::GetFileMetadata. Replace the catch-all arm with unreachable!() so future error variants are not silently mapped to a generic Io classification. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
519acda794
commit
a8d339c9e7
@@ -36,7 +36,7 @@ impl disk_file::PhysicalSize for FixedVhdDiskAsync {
|
||||
crate::Error::GetFileMetadata(io) => {
|
||||
BlockError::new(BlockErrorKind::Io, crate::Error::GetFileMetadata(io))
|
||||
}
|
||||
_ => BlockError::new(BlockErrorKind::Io, e),
|
||||
_ => unreachable!("unexpected error from FixedVhd::physical_size(): {e}"),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ impl disk_file::PhysicalSize for FixedVhdDiskSync {
|
||||
crate::Error::GetFileMetadata(io) => {
|
||||
BlockError::new(BlockErrorKind::Io, crate::Error::GetFileMetadata(io))
|
||||
}
|
||||
_ => BlockError::new(BlockErrorKind::Io, e),
|
||||
_ => unreachable!("unexpected error from FixedVhd::physical_size(): {e}"),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user