mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
runtime-rs: Add support for handling virtio-scsi devices
As virtio-scsi has been set the default block device driver, the runtime also need to correctly handle the virtio-scsi info, specially the SCSI address required within kata-agent handling logic. And getting and assigning the scsi_addr to kata agent device id will be enough. This commit just do such work. Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
This commit is contained in:
@@ -434,10 +434,11 @@ impl ResourceManagerInner {
|
||||
// create block device for kata agent,
|
||||
// if driver is virtio-blk-pci, the id will be pci address.
|
||||
if let DeviceType::Block(device) = device_info {
|
||||
// The following would work for drivers virtio-blk-pci and mmio.
|
||||
// Once scsi support is added, need to handle scsi identifiers.
|
||||
// The following would work for drivers virtio-blk-pci and virtio-mmio and virtio-scsi.
|
||||
let id = if let Some(pci_path) = device.config.pci_path {
|
||||
pci_path.to_string()
|
||||
} else if let Some(scsi_address) = device.config.scsi_addr {
|
||||
scsi_address
|
||||
} else {
|
||||
device.config.virt_path.clone()
|
||||
};
|
||||
|
Reference in New Issue
Block a user