mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 16:36:38 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user