mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-17 07:27:22 +00:00
runtime-rs: Provide PCI path to the agent for virtio-block
If PCI path for block device is not empty for a block device, use that as identifier for agent instead of virt path which is valid only for mmio devices. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
a2bbbad711
commit
c3ce6a1d15
@ -297,8 +297,16 @@ impl ResourceManagerInner {
|
|||||||
// create block device for kata agent,
|
// create block device for kata agent,
|
||||||
// if driver is virtio-blk-pci, the id will be pci address.
|
// if driver is virtio-blk-pci, the id will be pci address.
|
||||||
if let DeviceType::Block(device) = device_info {
|
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.
|
||||||
|
let id = if let Some(pci_path) = device.config.pci_path {
|
||||||
|
pci_path.convert_to_string()
|
||||||
|
} else {
|
||||||
|
device.config.virt_path.clone()
|
||||||
|
};
|
||||||
|
|
||||||
let agent_device = Device {
|
let agent_device = Device {
|
||||||
id: device.config.virt_path.clone(),
|
id,
|
||||||
container_path: d.path.clone(),
|
container_path: d.path.clone(),
|
||||||
field_type: device.config.driver_option,
|
field_type: device.config.driver_option,
|
||||||
vm_path: device.config.virt_path,
|
vm_path: device.config.virt_path,
|
||||||
|
Loading…
Reference in New Issue
Block a user