Skip to content

Commit

Permalink
Rename the uart log to console.log, as we still need to log stdout/er…
Browse files Browse the repository at this point in the history
…r and this probably makes more sense to name generically log. Allow specification of raw or device HDDs, by not prepending the file:// which qcow requires
  • Loading branch information
bensallen committed Mar 5, 2020
1 parent af58b82 commit 1a06ac6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions internal/config/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (v *VMConfig) Cli() []string {
args = append(args, "-A", "-s", "0:0,hostbridge", "-s", "31,lpc", "-s", "1,virtio-rnd")

if v.RunDir != "" {
args = append(args, "-l", fmt.Sprintf("com1,autopty=%s/tty,log=%s/log", v.RunDir, v.RunDir))
args = append(args, "-l", fmt.Sprintf("com1,autopty=%s/tty,log=%s/console.log", v.RunDir, v.RunDir))
}

for i, net := range v.Network {
Expand All @@ -202,7 +202,12 @@ func (v *VMConfig) Cli() []string {
}

for i, hdd := range v.HDD {
args = append(args, "-s", fmt.Sprintf("3:%d,%s,file://%s,format=%s", i, hdd.Driver, hdd.Path, hdd.Format))
switch hdd.Format {
case "qcow":
args = append(args, "-s", fmt.Sprintf("3:%d,%s,file://%s,format=qcow", i, hdd.Driver, hdd.Path))
case "raw", "dev", "":
args = append(args, "-s", fmt.Sprintf("3:%d,%s,%s", i, hdd.Driver, hdd.Path))
}
}

for i, cd := range v.CDROM {
Expand Down

0 comments on commit 1a06ac6

Please sign in to comment.