kata_agent: Pass "VirtPath" with "PCIAddr" of blk devices to agent

[ port from runtime commit 50c1dce137bb3d608daa931c01e4941ed5fdb6cc ]

In case the "PCIAddr" of block devices is not available (e.g.
cloud-hypervisor), we also pass the "VirtPath" to the agent for adding
block devices to the container.

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Bo Chen 2020-06-29 20:55:43 -07:00 committed by Peng Tao
parent 56ae20990d
commit 2d6c0731eb

View File

@ -1221,6 +1221,7 @@ func (k *kataAgent) appendBlockDevice(dev ContainerDevice, c *Container) *grpc.D
case config.VirtioBlock:
kataDevice.Type = kataBlkDevType
kataDevice.Id = d.PCIAddr
kataDevice.VmPath = d.VirtPath
case config.VirtioSCSI:
kataDevice.Type = kataSCSIDevType
kataDevice.Id = d.SCSIAddr