mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
kata_agent: Allow to use "VirtPath" as volume source for blk devices
[ port from runtime commit aea29b64b66f75049cb045f9e41dff2becdbebdc ] When the "PCIAddr" of block device is not available (e.g. cloud-hypervisor), we allow to use the "VirtPath" as the volume source for creating containers. Signed-off-by: Bo Chen <chen.bo@intel.com> Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
parent
bdd386ba14
commit
56ae20990d
@ -1587,7 +1587,11 @@ func (k *kataAgent) handleDeviceBlockVolume(c *Container, device api.Device) (*g
|
||||
vol.Source = blockDrive.DevNo
|
||||
case c.sandbox.config.HypervisorConfig.BlockDeviceDriver == config.VirtioBlock:
|
||||
vol.Driver = kataBlkDevType
|
||||
vol.Source = blockDrive.PCIAddr
|
||||
if blockDrive.PCIAddr == "" {
|
||||
vol.Source = blockDrive.VirtPath
|
||||
} else {
|
||||
vol.Source = blockDrive.PCIAddr
|
||||
}
|
||||
case c.sandbox.config.HypervisorConfig.BlockDeviceDriver == config.VirtioMmio:
|
||||
vol.Driver = kataMmioBlkDevType
|
||||
vol.Source = blockDrive.VirtPath
|
||||
|
Loading…
Reference in New Issue
Block a user