mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-10 13:54:12 +00:00
cli: 9p: Add toml configuration for 9p msize
Allows msize for 9p to be configured in the toml file. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
3187a98188
commit
cc61ccf9e9
4
Makefile
4
Makefile
@ -107,6 +107,7 @@ DEFENABLEHUGEPAGES := false
|
|||||||
DEFENABLESWAP := false
|
DEFENABLESWAP := false
|
||||||
DEFENABLEDEBUG := false
|
DEFENABLEDEBUG := false
|
||||||
DEFDISABLENESTINGCHECKS := false
|
DEFDISABLENESTINGCHECKS := false
|
||||||
|
DEFMSIZE9P := 8192
|
||||||
|
|
||||||
SED = sed
|
SED = sed
|
||||||
|
|
||||||
@ -179,6 +180,7 @@ USER_VARS += DEFENABLEHUGEPAGES
|
|||||||
USER_VARS += DEFENABLESWAP
|
USER_VARS += DEFENABLESWAP
|
||||||
USER_VARS += DEFENABLEDEBUG
|
USER_VARS += DEFENABLEDEBUG
|
||||||
USER_VARS += DEFDISABLENESTINGCHECKS
|
USER_VARS += DEFDISABLENESTINGCHECKS
|
||||||
|
USER_VARS += DEFMSIZE9P
|
||||||
|
|
||||||
V = @
|
V = @
|
||||||
Q = $(V:1=)
|
Q = $(V:1=)
|
||||||
@ -271,6 +273,7 @@ const defaultEnableHugePages bool = $(DEFENABLEHUGEPAGES)
|
|||||||
const defaultEnableSwap bool = $(DEFENABLESWAP)
|
const defaultEnableSwap bool = $(DEFENABLESWAP)
|
||||||
const defaultEnableDebug bool = $(DEFENABLEDEBUG)
|
const defaultEnableDebug bool = $(DEFENABLEDEBUG)
|
||||||
const defaultDisableNestingChecks bool = $(DEFDISABLENESTINGCHECKS)
|
const defaultDisableNestingChecks bool = $(DEFDISABLENESTINGCHECKS)
|
||||||
|
const defaultMsize9p uint32 = $(DEFMSIZE9P)
|
||||||
|
|
||||||
// Default config file used by stateless systems.
|
// Default config file used by stateless systems.
|
||||||
var defaultRuntimeConfiguration = "$(DESTCONFIG)"
|
var defaultRuntimeConfiguration = "$(DESTCONFIG)"
|
||||||
@ -355,6 +358,7 @@ $(GENERATED_FILES): %: %.in Makefile VERSION
|
|||||||
-e "s|@DEFENABLEMSWAP@|$(DEFENABLESWAP)|g" \
|
-e "s|@DEFENABLEMSWAP@|$(DEFENABLESWAP)|g" \
|
||||||
-e "s|@DEFENABLEDEBUG@|$(DEFENABLEDEBUG)|g" \
|
-e "s|@DEFENABLEDEBUG@|$(DEFENABLEDEBUG)|g" \
|
||||||
-e "s|@DEFDISABLENESTINGCHECKS@|$(DEFDISABLENESTINGCHECKS)|g" \
|
-e "s|@DEFDISABLENESTINGCHECKS@|$(DEFDISABLENESTINGCHECKS)|g" \
|
||||||
|
-e "s|@DEFMSIZE9P@|$(DEFMSIZE9P)|g" \
|
||||||
$< > $@
|
$< > $@
|
||||||
|
|
||||||
generate-config: $(CONFIG)
|
generate-config: $(CONFIG)
|
||||||
|
@ -93,6 +93,7 @@ type hypervisor struct {
|
|||||||
Debug bool `toml:"enable_debug"`
|
Debug bool `toml:"enable_debug"`
|
||||||
DisableNestingChecks bool `toml:"disable_nesting_checks"`
|
DisableNestingChecks bool `toml:"disable_nesting_checks"`
|
||||||
EnableIOThreads bool `toml:"enable_iothreads"`
|
EnableIOThreads bool `toml:"enable_iothreads"`
|
||||||
|
Msize9p uint32 `toml:"msize_9p"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type proxy struct {
|
type proxy struct {
|
||||||
@ -242,6 +243,14 @@ func (h hypervisor) blockDeviceDriver() (string, error) {
|
|||||||
return h.BlockDeviceDriver, nil
|
return h.BlockDeviceDriver, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h hypervisor) msize9p() uint32 {
|
||||||
|
if h.Msize9p == 0 {
|
||||||
|
return defaultMsize9p
|
||||||
|
}
|
||||||
|
|
||||||
|
return h.Msize9p
|
||||||
|
}
|
||||||
|
|
||||||
func (p proxy) path() string {
|
func (p proxy) path() string {
|
||||||
if p.Path == "" {
|
if p.Path == "" {
|
||||||
return defaultProxyPath
|
return defaultProxyPath
|
||||||
@ -323,6 +332,7 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
|
|||||||
DisableNestingChecks: h.DisableNestingChecks,
|
DisableNestingChecks: h.DisableNestingChecks,
|
||||||
BlockDeviceDriver: blockDriver,
|
BlockDeviceDriver: blockDriver,
|
||||||
EnableIOThreads: h.EnableIOThreads,
|
EnableIOThreads: h.EnableIOThreads,
|
||||||
|
Msize9p: h.msize9p(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,6 +436,7 @@ func loadConfiguration(configPath string, ignoreLogging bool) (resolvedConfigPat
|
|||||||
DisableNestingChecks: defaultDisableNestingChecks,
|
DisableNestingChecks: defaultDisableNestingChecks,
|
||||||
BlockDeviceDriver: defaultBlockDeviceDriver,
|
BlockDeviceDriver: defaultBlockDeviceDriver,
|
||||||
EnableIOThreads: defaultEnableIOThreads,
|
EnableIOThreads: defaultEnableIOThreads,
|
||||||
|
Msize9p: defaultMsize9p,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = config.InterNetworkModel.SetModel(defaultInterNetworkingModel)
|
err = config.InterNetworkModel.SetModel(defaultInterNetworkingModel)
|
||||||
|
@ -110,6 +110,10 @@ enable_iothreads = @DEFENABLEIOTHREADS@
|
|||||||
#
|
#
|
||||||
#disable_nesting_checks = true
|
#disable_nesting_checks = true
|
||||||
|
|
||||||
|
# This is the msize used for 9p shares. It is the number of bytes
|
||||||
|
# used for 9p packet payload.
|
||||||
|
#msize_9p = @DEFMSIZE9P@
|
||||||
|
|
||||||
[proxy.@PROJECT_TYPE@]
|
[proxy.@PROJECT_TYPE@]
|
||||||
path = "@PROXYPATH@"
|
path = "@PROXYPATH@"
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ func makeRuntimeConfigFileData(hypervisor, hypervisorPath, kernelPath, imagePath
|
|||||||
default_memory = ` + strconv.FormatUint(uint64(defaultMemSize), 10) + `
|
default_memory = ` + strconv.FormatUint(uint64(defaultMemSize), 10) + `
|
||||||
disable_block_device_use = ` + strconv.FormatBool(disableBlock) + `
|
disable_block_device_use = ` + strconv.FormatBool(disableBlock) + `
|
||||||
enable_iothreads = ` + strconv.FormatBool(enableIOThreads) + `
|
enable_iothreads = ` + strconv.FormatBool(enableIOThreads) + `
|
||||||
|
msize_9p = ` + strconv.FormatUint(uint64(defaultMsize9p), 10) + `
|
||||||
|
|
||||||
[proxy.kata]
|
[proxy.kata]
|
||||||
path = "` + proxyPath + `"
|
path = "` + proxyPath + `"
|
||||||
@ -143,6 +144,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
|
|||||||
DefaultBridges: defaultBridgesCount,
|
DefaultBridges: defaultBridgesCount,
|
||||||
Mlock: !defaultEnableSwap,
|
Mlock: !defaultEnableSwap,
|
||||||
EnableIOThreads: enableIOThreads,
|
EnableIOThreads: enableIOThreads,
|
||||||
|
Msize9p: defaultMsize9p,
|
||||||
}
|
}
|
||||||
|
|
||||||
agentConfig := vc.KataAgentConfig{}
|
agentConfig := vc.KataAgentConfig{}
|
||||||
@ -525,6 +527,7 @@ func TestMinimalRuntimeConfig(t *testing.T) {
|
|||||||
DefaultBridges: defaultBridgesCount,
|
DefaultBridges: defaultBridgesCount,
|
||||||
Mlock: !defaultEnableSwap,
|
Mlock: !defaultEnableSwap,
|
||||||
BlockDeviceDriver: defaultBlockDeviceDriver,
|
BlockDeviceDriver: defaultBlockDeviceDriver,
|
||||||
|
Msize9p: defaultMsize9p,
|
||||||
}
|
}
|
||||||
|
|
||||||
expectedAgentConfig := vc.KataAgentConfig{}
|
expectedAgentConfig := vc.KataAgentConfig{}
|
||||||
|
Loading…
Reference in New Issue
Block a user