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

Commit

Permalink
kata_agent: Don't use dax if virtio_fs_cache is 0
Browse files Browse the repository at this point in the history
If always using dax, even if virtio_fs_cache is 0, the following error
would happen:

```
[root@f32 runtime]# podman run --security-opt label=disable  --runtime=/usr/local/bin/kata-runtime --rm -id fedora sh
Error: rpc error: code = Internal desc = Could not mount kataShared to /run/kata-containers/shared/containers/: invalid argument: OCI runtime error
```

Fixes: #2464

Signed-off-by: Fabiano Fidêncio <[email protected]>
  • Loading branch information
fidencio authored and amshinde committed Apr 13, 2020
1 parent 6218b2a commit ab8050c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,10 @@ func setupStorages(sandbox *Sandbox) []*grpc.Storage {
// options should not contain 'dax' lest the virtio-fs daemon crashing
// with an invalid address reference.
if sandbox.config.HypervisorConfig.VirtioFSCache != typeVirtioFSNoCache {
sharedDirVirtioFSOptions = append(sharedDirVirtioFSOptions, sharedDirVirtioFSDaxOptions)
// If virtio_fs_cache_size = 0, dax should not be used.
if sandbox.config.HypervisorConfig.VirtioFSCacheSize != 0 {
sharedDirVirtioFSOptions = append(sharedDirVirtioFSOptions, sharedDirVirtioFSDaxOptions)
}
}
sharedVolume := &grpc.Storage{
Driver: kataVirtioFSDevType,
Expand Down

0 comments on commit ab8050c

Please sign in to comment.