mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-28 00:07:16 +00:00
Merge pull request #1101 from devimc/2020-11-06/runtime/fixClhDax
runtime: clh: disable virtiofs DAX when FS cache size is 0
This commit is contained in:
commit
258dd55855
@ -1197,22 +1197,23 @@ func (clh *cloudHypervisor) addVolume(volume types.Volume) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if clh.config.VirtioFSCache == virtioFsCacheAlways {
|
||||
clh.vmconfig.Fs = []chclient.FsConfig{
|
||||
{
|
||||
Tag: volume.MountTag,
|
||||
CacheSize: int64(clh.config.VirtioFSCacheSize << 20),
|
||||
Socket: vfsdSockPath,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
clh.vmconfig.Fs = []chclient.FsConfig{
|
||||
{
|
||||
Tag: volume.MountTag,
|
||||
Socket: vfsdSockPath,
|
||||
},
|
||||
}
|
||||
// disable DAX if VirtioFSCacheSize is 0
|
||||
dax := clh.config.VirtioFSCacheSize != 0
|
||||
|
||||
// numQueues and queueSize are required, let's use the
|
||||
// default values defined by cloud-hypervisor
|
||||
numQueues := int32(1)
|
||||
queueSize := int32(1024)
|
||||
|
||||
clh.vmconfig.Fs = []chclient.FsConfig{
|
||||
{
|
||||
Tag: volume.MountTag,
|
||||
Socket: vfsdSockPath,
|
||||
Dax: dax,
|
||||
CacheSize: int64(clh.config.VirtioFSCacheSize << 20),
|
||||
NumQueues: numQueues,
|
||||
QueueSize: queueSize,
|
||||
},
|
||||
}
|
||||
|
||||
clh.Logger().Debug("Adding share volume to hypervisor: ", volume.MountTag)
|
||||
|
@ -1078,6 +1078,10 @@ components:
|
||||
id:
|
||||
type: string
|
||||
required:
|
||||
- cache_size
|
||||
- dax
|
||||
- num_queues
|
||||
- queue_size
|
||||
- socket
|
||||
- tag
|
||||
type: object
|
||||
|
@ -6,10 +6,10 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Tag** | **string** | |
|
||||
**Socket** | **string** | |
|
||||
**NumQueues** | **int32** | | [optional] [default to 1]
|
||||
**QueueSize** | **int32** | | [optional] [default to 1024]
|
||||
**Dax** | **bool** | | [optional] [default to true]
|
||||
**CacheSize** | **int64** | | [optional]
|
||||
**NumQueues** | **int32** | | [default to 1]
|
||||
**QueueSize** | **int32** | | [default to 1024]
|
||||
**Dax** | **bool** | | [default to true]
|
||||
**CacheSize** | **int64** | |
|
||||
**Id** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@ -12,9 +12,9 @@ package openapi
|
||||
type FsConfig struct {
|
||||
Tag string `json:"tag"`
|
||||
Socket string `json:"socket"`
|
||||
NumQueues int32 `json:"num_queues,omitempty"`
|
||||
QueueSize int32 `json:"queue_size,omitempty"`
|
||||
Dax bool `json:"dax,omitempty"`
|
||||
CacheSize int64 `json:"cache_size,omitempty"`
|
||||
NumQueues int32 `json:"num_queues"`
|
||||
QueueSize int32 `json:"queue_size"`
|
||||
Dax bool `json:"dax"`
|
||||
CacheSize int64 `json:"cache_size"`
|
||||
Id string `json:"id,omitempty"`
|
||||
}
|
||||
|
@ -654,8 +654,12 @@ components:
|
||||
|
||||
FsConfig:
|
||||
required:
|
||||
- tag
|
||||
- cache_size
|
||||
- dax
|
||||
- num_queues
|
||||
- queue_size
|
||||
- socket
|
||||
- tag
|
||||
type: object
|
||||
properties:
|
||||
tag:
|
||||
|
@ -75,7 +75,7 @@ assets:
|
||||
url: "https://github.com/cloud-hypervisor/cloud-hypervisor"
|
||||
uscan-url: >-
|
||||
https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz
|
||||
version: "v0.11.0"
|
||||
version: "270631922deee9bdea13635a104e111768446c7b"
|
||||
|
||||
firecracker:
|
||||
description: "Firecracker micro-VMM"
|
||||
|
Loading…
Reference in New Issue
Block a user