Implement qemu-system stderr log passthrough
This commit is contained in:
parent
9ccd820e71
commit
ec99bc4ef1
5 changed files with 11 additions and 6 deletions
7
vm/vm.go
7
vm/vm.go
|
|
@ -22,6 +22,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
|
@ -99,7 +100,7 @@ type Config struct {
|
|||
SSHUpTimeout time.Duration
|
||||
|
||||
// Mostly debug-related options.
|
||||
ShowDisplay bool
|
||||
Debug bool // This will show the display and forward all QEMU warnings/errors to stderr.
|
||||
InstallBaseUtilities bool
|
||||
}
|
||||
|
||||
|
|
@ -176,6 +177,10 @@ func NewVM(logger *slog.Logger, cfg Config) (*VM, error) {
|
|||
stderrBuf := bytes.NewBuffer(nil)
|
||||
cmd.Stderr = stderrBuf
|
||||
|
||||
if cfg.Debug {
|
||||
cmd.Stderr = io.MultiWriter(cmd.Stderr, os.Stderr)
|
||||
}
|
||||
|
||||
// This function is OS-specific.
|
||||
osspecifics.SetNewProcessGroupCmd(cmd)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue