mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 00:07:55 +00:00
Merge pull request #373 from likebreath/fix-248
agent: device: Allow "VmPath" to be used when adding block devices
This commit is contained in:
@@ -298,7 +298,13 @@ fn virtio_blk_device_handler(
|
|||||||
sandbox: &Arc<Mutex<Sandbox>>,
|
sandbox: &Arc<Mutex<Sandbox>>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let mut dev = device.clone();
|
let mut dev = device.clone();
|
||||||
|
|
||||||
|
// When "Id (PCIAddr)" is not set, we allow to use the predicted "VmPath" passed from kata-runtime
|
||||||
|
// Note this is a special code path for cloud-hypervisor when BDF information is not available
|
||||||
|
if device.id != "" {
|
||||||
dev.vm_path = get_pci_device_name(sandbox, &device.id)?;
|
dev.vm_path = get_pci_device_name(sandbox, &device.id)?;
|
||||||
|
}
|
||||||
|
|
||||||
update_spec_device_list(&dev, spec)
|
update_spec_device_list(&dev, spec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user