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:
Archana Shinde
2018-04-13 10:44:07 -07:00
parent 8088a62805
commit 3187a98188
6 changed files with 15 additions and 0 deletions

View File

@@ -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{

View File

@@ -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
}

View File

@@ -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()
}

View File

@@ -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

View File

@@ -108,6 +108,7 @@ const (
defaultCPUModel = "host"
defaultBridgeBus = "pcie.0"
maxDevIDSize = 31
defaultMsize9p = 8192
)
const (

View File

@@ -39,6 +39,7 @@ func newQemuConfig() HypervisorConfig {
DefaultBridges: defaultBridges,
BlockDeviceDriver: defaultBlockDriver,
DefaultMaxVCPUs: defaultMaxQemuVCPUs,
Msize9p: defaultMsize9p,
}
}