mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Make detect_image_type return BlockResult with context
Convert detect_image_type() from io::Result to BlockResult so that I/O failures carry the operation name in the error context. Update the corresponding vmm error variant to wrap BlockError. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
58bdfaee3a
commit
b1bc376c91
@@ -41,7 +41,7 @@ use block::raw_sync::RawFileDiskSync;
|
||||
use block::vhdx_sync::VhdxDiskSync;
|
||||
use block::{
|
||||
ImageType, block_aio_is_supported, block_io_uring_is_supported, detect_image_type,
|
||||
preallocate_disk, qcow, vhdx,
|
||||
preallocate_disk, vhdx,
|
||||
};
|
||||
#[cfg(feature = "io_uring")]
|
||||
use block::{fixed_vhd_async::FixedVhdDiskAsync, raw_async::RawFileDisk};
|
||||
@@ -266,7 +266,7 @@ pub enum DeviceManagerError {
|
||||
|
||||
/// Failed to parse disk image format
|
||||
#[error("Failed to parse disk image format")]
|
||||
DetectImageType(#[source] io::Error),
|
||||
DetectImageType(#[source] BlockError),
|
||||
|
||||
/// Cannot create serial manager
|
||||
#[error("Cannot create serial manager")]
|
||||
|
||||
Reference in New Issue
Block a user