Skip to content

Commit

Permalink
9p: Add hypervisor configuration for 9p msize
Browse files Browse the repository at this point in the history
This allows msize option for 9p to be configured and tuned.

Fixes kata-containers#206

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed Apr 16, 2018
1 parent ad5669f commit 45a32f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions virtcontainers/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -257,6 +260,10 @@ func (conf *HypervisorConfig) valid() (bool, error) {
conf.DefaultMaxVCPUs = defaultMaxQemuVCPUs
}

if conf.Msize9p == 0 {
conf.Msize9p = defaultMsize9p
}

return true, nil
}

Expand Down
2 changes: 2 additions & 0 deletions virtcontainers/kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions virtcontainers/qemu_arch_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const (
defaultCPUModel = "host"
defaultBridgeBus = "pcie.0"
maxDevIDSize = 31
defaultMsize9p = 8192
)

const (
Expand Down

0 comments on commit 45a32f2

Please sign in to comment.