mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-18 15:28:10 +00:00
runtime-rs: Support virtio-scsi device within handle_block_volume
It supports handling scsi device when block device driver is `scsi`. And it will ensure a correct storage source with LUN. Fixes #11516 Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -26,6 +26,7 @@ pub const DEFAULT_VOLUME_FS_TYPE: &str = "ext4";
|
||||
pub const KATA_MOUNT_BIND_TYPE: &str = "bind";
|
||||
|
||||
pub const KATA_BLK_DEV_TYPE: &str = "blk";
|
||||
pub const KATA_SCSI_DEV_TYPE: &str = "scsi";
|
||||
|
||||
pub fn get_file_name<P: AsRef<Path>>(src: P) -> Result<String> {
|
||||
let file_name = src
|
||||
@@ -99,6 +100,13 @@ pub async fn handle_block_volume(
|
||||
return Err(anyhow!("block driver is blk but no pci path exists"));
|
||||
}
|
||||
}
|
||||
KATA_SCSI_DEV_TYPE => {
|
||||
if let Some(scsi_addr) = device.config.scsi_addr {
|
||||
scsi_addr.to_string()
|
||||
} else {
|
||||
return Err(anyhow!("block driver is scsi but no scsi address exists"));
|
||||
}
|
||||
}
|
||||
_ => device.config.virt_path,
|
||||
};
|
||||
device_id = device.device_id;
|
||||
|
Reference in New Issue
Block a user