Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit c8033af

Browse files
authored
Merge pull request #517 from WeiZhang555/bugfix-choose-cbfs
Modify if statement to choose appropriate cbfs/kernel
2 parents dac6bdc + ba5e4c9 commit c8033af

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

create.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@ func runContainer(context *cli.Context, createOnly bool) {
156156
"--default_memory", fmt.Sprintf("%d", context.GlobalInt("default_memory")),
157157
}
158158

159-
// if user set bios+cbfs, then use bios+cbfs first
160-
if context.GlobalString("bios") != "" && context.GlobalString("cbfs") != "" {
159+
// if bios+cbfs exist, use them first.
160+
if bios != "" && cbfs != "" {
161161
args = append(args, "--bios", bios, "--cbfs", cbfs)
162-
} else {
162+
} else if kernel != "" && initrd != "" {
163163
args = append(args, "--kernel", kernel, "--initrd", initrd)
164+
} else {
165+
fmt.Fprintf(os.Stderr, "either bios+cbfs or kernel+initrd must be specified")
166+
os.Exit(-1)
164167
}
165168

166169
if context.GlobalBool("debug") {

0 commit comments

Comments
 (0)