Merge pull request #373 from likebreath/fix-248

agent: device: Allow "VmPath" to be used when adding block devices
This commit is contained in:
Peng Tao
2020-07-03 18:04:05 +08:00
committed by GitHub

View File

@@ -298,7 +298,13 @@ fn virtio_blk_device_handler(
sandbox: &Arc<Mutex<Sandbox>>,
) -> Result<()> {
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)?;
}
update_spec_device_list(&dev, spec)
}