mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 21:18:54 +00:00
kata_agent: Don't use dax if virtio_fs_cache is 0
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 <fidencio@redhat.com>
This commit is contained in:
parent
6218b2a558
commit
ab8050c5e0
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user