From c2e9801a97e0b664581f35869738f8a210d825c9 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 9 Mar 2018 10:07:57 -0800 Subject: [PATCH] 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 --- virtcontainers/kata_agent.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/virtcontainers/kata_agent.go b/virtcontainers/kata_agent.go index be12106fd3..a8017fa58a 100644 --- a/virtcontainers/kata_agent.go +++ b/virtcontainers/kata_agent.go @@ -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