From 9820c0976586943946e7c193917a7547a883fe7f Mon Sep 17 00:00:00 2001 From: Misha Sakhnov Date: Tue, 22 Oct 2024 12:20:44 +0200 Subject: [PATCH] vm-runner: move comments for config fields to the struct definition Signed-off-by: Misha Sakhnov --- neonvm-runner/cmd/main.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/neonvm-runner/cmd/main.go b/neonvm-runner/cmd/main.go index fddbb2528..b92ed5dea 100644 --- a/neonvm-runner/cmd/main.go +++ b/neonvm-runner/cmd/main.go @@ -617,10 +617,14 @@ type Config struct { appendKernelCmdline string skipCgroupManagement bool diskCacheSettings string - memoryProvider vmv1.MemoryProvider - autoMovableRatio string - cpuScalingMode string - architecture string + // memoryProvider is a memory provider to use. Validated in newConfig. + memoryProvider vmv1.MemoryProvider + // autoMovableRatio value for VirtioMem provider. Validated in newConfig. + autoMovableRatio string + // cpuScalingMode is a mode to use for CPU scaling. Validated in newConfig. + cpuScalingMode string + // System CPU architecture. Set automatically equal to runtime.GOARCH. + architecture string } func newConfig(logger *zap.Logger) *Config { @@ -631,10 +635,10 @@ func newConfig(logger *zap.Logger) *Config { appendKernelCmdline: "", skipCgroupManagement: false, diskCacheSettings: "cache=none", - memoryProvider: "", // Require that this is explicitly set. We'll check later. - autoMovableRatio: "", // Require that this is explicitly set IFF memoryProvider is VirtioMem. We'll check later. - cpuScalingMode: "", // Require that this is explicitly set. We'll check later. - architecture: runtime.GOARCH, // arm64, amd64 + memoryProvider: "", + autoMovableRatio: "", + cpuScalingMode: "", + architecture: runtime.GOARCH, } flag.StringVar(&cfg.vmSpecDump, "vmspec", cfg.vmSpecDump, "Base64 encoded VirtualMachine json specification")