mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-25 18:53:44 +00:00
runtime: Support virtiofs queue size for qemu and make it configurable
The default vhost-user-fs queue-size of qemu is 128 now. Set it to 1024 by default which is same as clh. Also make this value configurable. Fixes: #5694 Signed-off-by: liyuxuan.darfux <liyuxuan.darfux@bytedance.com>
This commit is contained in:
@@ -1587,6 +1587,9 @@ func (clh *cloudHypervisor) addVolume(volume types.Volume) error {
|
||||
// default values defined by cloud-hypervisor
|
||||
numQueues := int32(1)
|
||||
queueSize := int32(1024)
|
||||
if clh.config.VirtioFSQueueSize != 0 {
|
||||
queueSize = int32(clh.config.VirtioFSQueueSize)
|
||||
}
|
||||
|
||||
fs := chclient.NewFsConfig(volume.MountTag, vfsdSockPath, numQueues, queueSize)
|
||||
clh.vmconfig.Fs = &[]chclient.FsConfig{*fs}
|
||||
|
@@ -467,6 +467,9 @@ type HypervisorConfig struct {
|
||||
// VirtioFSCacheSize is the DAX cache size in MiB
|
||||
VirtioFSCacheSize uint32
|
||||
|
||||
// Size of virtqueues
|
||||
VirtioFSQueueSize uint32
|
||||
|
||||
// User ID.
|
||||
Uid uint32
|
||||
|
||||
|
@@ -2080,6 +2080,7 @@ func (q *qemu) AddDevice(ctx context.Context, devInfo interface{}, devType Devic
|
||||
Type: config.VhostUserFS,
|
||||
CacheSize: q.config.VirtioFSCacheSize,
|
||||
Cache: q.config.VirtioFSCache,
|
||||
QueueSize: q.config.VirtioFSQueueSize,
|
||||
}
|
||||
vhostDev.SocketPath = sockPath
|
||||
vhostDev.DevID = id
|
||||
|
@@ -663,6 +663,7 @@ func (q *qemuArchBase) appendVhostUserDevice(ctx context.Context, devices []govm
|
||||
qemuVhostUserDevice.TypeDevID = utils.MakeNameID("fs", attr.DevID, maxDevIDSize)
|
||||
qemuVhostUserDevice.Tag = attr.Tag
|
||||
qemuVhostUserDevice.CacheSize = attr.CacheSize
|
||||
qemuVhostUserDevice.QueueSize = attr.QueueSize
|
||||
qemuVhostUserDevice.VhostUserType = govmmQemu.VhostUserFS
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user