Skip to content

Commit 830bce2

Browse files
author
Zhou Hao
authored
Merge pull request #676 from tych0/fix-up-vm-params
fix up vm parameters
2 parents f60dccd + 1f0579c commit 830bce2

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

Godeps/Godeps.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/oci-runtime-tool/generate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ var generateFlags = []cli.Flag{
128128
cli.StringFlag{Name: "solaris-max-shm-memory", Usage: "Specifies the maximum amount of shared memory"},
129129
cli.StringFlag{Name: "solaris-milestone", Usage: "Specifies the SMF FMRI"},
130130
cli.StringFlag{Name: "template", Usage: "base template to use for creating the configuration"},
131-
cli.StringFlag{Name: "vm-hypervisor-parameters", Usage: "specifies an array of parameters to pass to the hypervisor"},
131+
cli.StringSliceFlag{Name: "vm-hypervisor-parameters", Usage: "specifies an array of parameters to pass to the hypervisor"},
132132
cli.StringFlag{Name: "vm-hypervisor-path", Usage: "specifies the path to the hypervisor binary that manages the container virtual machine"},
133133
cli.StringFlag{Name: "vm-image-format", Usage: "set the format of the container virtual machine root image"},
134134
cli.StringFlag{Name: "vm-image-path", Usage: "set path to the container virtual machine root image"},
135135
cli.StringFlag{Name: "vm-kernel-initrd", Usage: "set path to an initial ramdisk to be used by the container virtual machine"},
136-
cli.StringFlag{Name: "vm-kernel-parameters", Usage: "specifies an array of parameters to pass to the kernel"},
136+
cli.StringSliceFlag{Name: "vm-kernel-parameters", Usage: "specifies an array of parameters to pass to the kernel"},
137137
cli.StringFlag{Name: "vm-kernel-path", Usage: "set path to the kernel used to boot the container virtual machine"},
138138
cli.StringSliceFlag{Name: "windows-devices", Usage: "specifies a list of devices to be mapped into the container"},
139139
cli.StringFlag{Name: "windows-hyperv-utilityVMPath", Usage: "specifies the path to the image used for the utility VM"},
@@ -899,7 +899,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
899899
}
900900

901901
if context.IsSet("vm-hypervisor-parameters") {
902-
g.SetVMHypervisorParameters(context.String("vm-hypervisor-parameters"))
902+
g.SetVMHypervisorParameters(context.StringSlice("vm-hypervisor-parameters"))
903903
}
904904

905905
if context.IsSet("vm-kernel-path") {
@@ -909,7 +909,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
909909
}
910910

911911
if context.IsSet("vm-kernel-parameters") {
912-
g.SetVMKernelParameters(context.String("vm-kernel-parameters"))
912+
g.SetVMKernelParameters(context.StringSlice("vm-kernel-parameters"))
913913
}
914914

915915
if context.IsSet("vm-kernel-initrd") {

generate/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ func (g *Generator) SetVMHypervisorPath(path string) error {
16431643
}
16441644

16451645
// SetVMHypervisorParameters sets g.Config.VM.Hypervisor.Parameters
1646-
func (g *Generator) SetVMHypervisorParameters(parameters string) {
1646+
func (g *Generator) SetVMHypervisorParameters(parameters []string) {
16471647
g.initConfigVMHypervisor()
16481648
g.Config.VM.Hypervisor.Parameters = parameters
16491649
}
@@ -1659,7 +1659,7 @@ func (g *Generator) SetVMKernelPath(path string) error {
16591659
}
16601660

16611661
// SetVMKernelParameters sets g.Config.VM.Kernel.Parameters
1662-
func (g *Generator) SetVMKernelParameters(parameters string) {
1662+
func (g *Generator) SetVMKernelParameters(parameters []string) {
16631663
g.initConfigVMKernel()
16641664
g.Config.VM.Kernel.Parameters = parameters
16651665
}

vendor/github.com/opencontainers/runtime-spec/specs-go/config.go

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)