Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
kata_agent: Allow to use "VirtPath" as volume source for blk devices
Browse files Browse the repository at this point in the history
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.

Fixes: #2720

Signed-off-by: Bo Chen <[email protected]>
  • Loading branch information
likebreath committed Jun 2, 2020
1 parent 011ade5 commit aea29b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,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
Expand Down

0 comments on commit aea29b6

Please sign in to comment.