virtcontainers: kata_agent: Rely on Storage instead of Device for rootfs

The Kata agent has been reworked regarding Storage and Device
structures recently. It now expect that Storage is going to be
used for both volumes/mounts and rootfs, while Device will be
exclusive to devices passed through the VM that should appear
inside the container.

This commit implements this new way of handling volumes and
devices.

Fixes #56

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2018-03-09 10:07:57 -08:00
parent b111403c00
commit c2e9801a97

View File

@@ -49,6 +49,7 @@ var (
type9pFs = "9p"
devPath = "/dev"
vsockSocketScheme = "vsock"
kata9pDevType = "9p"
kataBlkDevType = "blk"
)
@@ -471,6 +472,7 @@ func (k *kataAgent) startPod(pod Pod) error {
// (resolv.conf, etc...) and potentially all container
// rootfs will reside.
sharedVolume := &grpc.Storage{
Driver: kata9pDevType,
Source: mountGuest9pTag,
MountPoint: kataGuestSharedDir,
Fstype: type9pFs,
@@ -611,14 +613,7 @@ func (k *kataAgent) createContainer(pod *Pod, c *Container) (*Process, error) {
// without trying to match and update it into the OCI spec list
// of actual devices. The device corresponding to the rootfs is
// a very specific case.
rootfsDevice := &grpc.Device{
Type: kataBlkDevType,
VmPath: virtPath,
ContainerPath: "",
}
ctrDevices = append(ctrDevices, rootfsDevice)
rootfs.Driver = kataBlkDevType
rootfs.Source = virtPath
rootfs.MountPoint = rootPathParent
rootfs.Fstype = c.state.Fstype