mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-18 13:04:36 +01:00
9p: Add hypervisor configuration for 9p msize
This allows msize option for 9p to be configured and tuned. Fixes #206 Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
@@ -913,6 +913,7 @@ func TestStatusSandboxSuccessfulStateReady(t *testing.T) {
|
||||
DefaultBridges: defaultBridges,
|
||||
BlockDeviceDriver: defaultBlockDriver,
|
||||
DefaultMaxVCPUs: defaultMaxQemuVCPUs,
|
||||
Msize9p: defaultMsize9p,
|
||||
}
|
||||
|
||||
expectedStatus := SandboxStatus{
|
||||
@@ -969,6 +970,7 @@ func TestStatusSandboxSuccessfulStateRunning(t *testing.T) {
|
||||
DefaultBridges: defaultBridges,
|
||||
BlockDeviceDriver: defaultBlockDriver,
|
||||
DefaultMaxVCPUs: defaultMaxQemuVCPUs,
|
||||
Msize9p: defaultMsize9p,
|
||||
}
|
||||
|
||||
expectedStatus := SandboxStatus{
|
||||
|
||||
@@ -226,6 +226,9 @@ type HypervisorConfig struct {
|
||||
// DisableNestingChecks is used to override customizations performed
|
||||
// when running on top of another VMM.
|
||||
DisableNestingChecks bool
|
||||
|
||||
// Msize9p is used as the msize for 9p shares
|
||||
Msize9p uint32
|
||||
}
|
||||
|
||||
func (conf *HypervisorConfig) valid() (bool, error) {
|
||||
@@ -257,6 +260,10 @@ func (conf *HypervisorConfig) valid() (bool, error) {
|
||||
conf.DefaultMaxVCPUs = defaultMaxQemuVCPUs
|
||||
}
|
||||
|
||||
if conf.Msize9p == 0 {
|
||||
conf.Msize9p = defaultMsize9p
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,9 @@ func TestHypervisorConfigDefaults(t *testing.T) {
|
||||
DefaultBridges: defaultBridges,
|
||||
BlockDeviceDriver: defaultBlockDriver,
|
||||
DefaultMaxVCPUs: defaultMaxQemuVCPUs,
|
||||
Msize9p: defaultMsize9p,
|
||||
}
|
||||
|
||||
if reflect.DeepEqual(hypervisorConfig, hypervisorConfigDefaultsExpected) == false {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
@@ -485,6 +485,8 @@ func (k *kataAgent) startSandbox(sandbox Sandbox) error {
|
||||
}
|
||||
}
|
||||
|
||||
sharedDir9pOptions = append(sharedDir9pOptions, fmt.Sprintf("msize=%d", sandbox.config.HypervisorConfig.Msize9p))
|
||||
|
||||
// We mount the shared directory in a predefined location
|
||||
// in the guest.
|
||||
// This is where at least some of the host config files
|
||||
|
||||
@@ -108,6 +108,7 @@ const (
|
||||
defaultCPUModel = "host"
|
||||
defaultBridgeBus = "pcie.0"
|
||||
maxDevIDSize = 31
|
||||
defaultMsize9p = 8192
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -39,6 +39,7 @@ func newQemuConfig() HypervisorConfig {
|
||||
DefaultBridges: defaultBridges,
|
||||
BlockDeviceDriver: defaultBlockDriver,
|
||||
DefaultMaxVCPUs: defaultMaxQemuVCPUs,
|
||||
Msize9p: defaultMsize9p,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user