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:
Bo Chen 2020-11-12 12:26:35 -08:00 committed by GitHub
commit 258dd55855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 25 deletions

View File

@ -1197,22 +1197,23 @@ func (clh *cloudHypervisor) addVolume(volume types.Volume) error {
return err return err
} }
if clh.config.VirtioFSCache == virtioFsCacheAlways { // disable DAX if VirtioFSCacheSize is 0
clh.vmconfig.Fs = []chclient.FsConfig{ dax := clh.config.VirtioFSCacheSize != 0
{
Tag: volume.MountTag,
CacheSize: int64(clh.config.VirtioFSCacheSize << 20),
Socket: vfsdSockPath,
},
}
} else {
clh.vmconfig.Fs = []chclient.FsConfig{
{
Tag: volume.MountTag,
Socket: vfsdSockPath,
},
}
// 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) clh.Logger().Debug("Adding share volume to hypervisor: ", volume.MountTag)

View File

@ -1078,6 +1078,10 @@ components:
id: id:
type: string type: string
required: required:
- cache_size
- dax
- num_queues
- queue_size
- socket - socket
- tag - tag
type: object type: object

View File

@ -6,10 +6,10 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Tag** | **string** | | **Tag** | **string** | |
**Socket** | **string** | | **Socket** | **string** | |
**NumQueues** | **int32** | | [optional] [default to 1] **NumQueues** | **int32** | | [default to 1]
**QueueSize** | **int32** | | [optional] [default to 1024] **QueueSize** | **int32** | | [default to 1024]
**Dax** | **bool** | | [optional] [default to true] **Dax** | **bool** | | [default to true]
**CacheSize** | **int64** | | [optional] **CacheSize** | **int64** | |
**Id** | **string** | | [optional] **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) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -12,9 +12,9 @@ package openapi
type FsConfig struct { type FsConfig struct {
Tag string `json:"tag"` Tag string `json:"tag"`
Socket string `json:"socket"` Socket string `json:"socket"`
NumQueues int32 `json:"num_queues,omitempty"` NumQueues int32 `json:"num_queues"`
QueueSize int32 `json:"queue_size,omitempty"` QueueSize int32 `json:"queue_size"`
Dax bool `json:"dax,omitempty"` Dax bool `json:"dax"`
CacheSize int64 `json:"cache_size,omitempty"` CacheSize int64 `json:"cache_size"`
Id string `json:"id,omitempty"` Id string `json:"id,omitempty"`
} }

View File

@ -654,8 +654,12 @@ components:
FsConfig: FsConfig:
required: required:
- tag - cache_size
- dax
- num_queues
- queue_size
- socket - socket
- tag
type: object type: object
properties: properties:
tag: tag:

View File

@ -75,7 +75,7 @@ assets:
url: "https://github.com/cloud-hypervisor/cloud-hypervisor" url: "https://github.com/cloud-hypervisor/cloud-hypervisor"
uscan-url: >- uscan-url: >-
https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz https://github.com/cloud-hypervisor/cloud-hypervisor/tags.*/v?(\d\S+)\.tar\.gz
version: "v0.11.0" version: "270631922deee9bdea13635a104e111768446c7b"
firecracker: firecracker:
description: "Firecracker micro-VMM" description: "Firecracker micro-VMM"