mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block_util, vhdx: vhdx crate integration with the cloud hypervisor
vhdx_sync.rs in block_util implements traits to represent the vhdx crate as a supported block device in the cloud hypervisor. The vhdx is added to the block device list in device_manager.rs at the vmm crate so that it can automatically detect a vhdx disk and invoke the corresponding crate. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> Signed-off-by: Fazla Mehrab <akm.fazla.mehrab@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
452af9b17c
commit
5db4dede28
@@ -39,7 +39,7 @@ use arch::{DeviceType, MmioDeviceInfo};
|
||||
use block_util::{
|
||||
async_io::DiskFile, block_io_uring_is_supported, detect_image_type,
|
||||
fixed_vhd_async::FixedVhdDiskAsync, fixed_vhd_sync::FixedVhdDiskSync, qcow_sync::QcowDiskSync,
|
||||
raw_async::RawFileDisk, raw_sync::RawFileDiskSync, ImageType,
|
||||
raw_async::RawFileDisk, raw_sync::RawFileDiskSync, vhdx_sync::VhdxDiskSync, ImageType,
|
||||
};
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
use devices::gic;
|
||||
@@ -420,6 +420,9 @@ pub enum DeviceManagerError {
|
||||
/// Failed to create QcowDiskSync
|
||||
CreateQcowDiskSync(qcow::Error),
|
||||
|
||||
/// Failed to create FixedVhdxDiskSync
|
||||
CreateFixedVhdxDiskSync(vhdx::vhdx::VhdxError),
|
||||
|
||||
/// Failed adding DMA mapping handler to virtio-mem device.
|
||||
AddDmaMappingHandlerVirtioMem(virtio_devices::mem::Error),
|
||||
|
||||
@@ -1944,6 +1947,13 @@ impl DeviceManager {
|
||||
.map_err(DeviceManagerError::CreateQcowDiskSync)?,
|
||||
) as Box<dyn DiskFile>
|
||||
}
|
||||
ImageType::Vhdx => {
|
||||
info!("Using synchronous VHDX disk file");
|
||||
Box::new(
|
||||
VhdxDiskSync::new(file)
|
||||
.map_err(DeviceManagerError::CreateFixedVhdxDiskSync)?,
|
||||
) as Box<dyn DiskFile>
|
||||
}
|
||||
};
|
||||
|
||||
let dev = Arc::new(Mutex::new(
|
||||
|
||||
Reference in New Issue
Block a user