mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block_util: Add synchronous support for fixed VHD disk files
Relying on the simplified version of the synchronous support for RAW disk files, the new fixed_vhd_sync module in the block_util crate introduces the synchronous support for fixed VHD disk files. With this patch, the fixed VHD support is complete as it is implemented in both synchronous and asynchronous versions. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
c6854c5a97
commit
24c8cce012
@@ -40,8 +40,8 @@ use arch::layout::{APIC_START, IOAPIC_SIZE, IOAPIC_START};
|
||||
use arch::DeviceType;
|
||||
use block_util::{
|
||||
async_io::DiskFile, block_io_uring_is_supported, detect_image_type,
|
||||
fixed_vhd_async::FixedVhdDiskAsync, qcow_sync::QcowDiskSync, raw_async::RawFileDisk,
|
||||
raw_sync::RawFileDiskSync, ImageType,
|
||||
fixed_vhd_async::FixedVhdDiskAsync, fixed_vhd_sync::FixedVhdDiskSync, qcow_sync::QcowDiskSync,
|
||||
raw_async::RawFileDisk, raw_sync::RawFileDiskSync, ImageType,
|
||||
};
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
use devices::gic;
|
||||
@@ -383,6 +383,9 @@ pub enum DeviceManagerError {
|
||||
|
||||
/// Failed to create FixedVhdDiskAsync
|
||||
CreateFixedVhdDiskAsync(io::Error),
|
||||
|
||||
/// Failed to create FixedVhdDiskSync
|
||||
CreateFixedVhdDiskSync(io::Error),
|
||||
}
|
||||
pub type DeviceManagerResult<T> = result::Result<T, DeviceManagerError>;
|
||||
|
||||
@@ -1675,7 +1678,11 @@ impl DeviceManager {
|
||||
.map_err(DeviceManagerError::CreateFixedVhdDiskAsync)?,
|
||||
) as Box<dyn DiskFile>
|
||||
} else {
|
||||
unimplemented!("No synchronous implementation for fixed VHD files");
|
||||
info!("Using synchronous fixed VHD disk file");
|
||||
Box::new(
|
||||
FixedVhdDiskSync::new(file)
|
||||
.map_err(DeviceManagerError::CreateFixedVhdDiskSync)?,
|
||||
) as Box<dyn DiskFile>
|
||||
}
|
||||
}
|
||||
ImageType::Raw => {
|
||||
|
||||
Reference in New Issue
Block a user