From 3e051edb004e634ed92155f39d430e0b4fe9823d Mon Sep 17 00:00:00 2001 From: HyeonCheol Yun Date: Fri, 3 Dec 2021 01:22:41 +0900 Subject: [PATCH] Fix condition to allow creating console on stdio Signed-off-by: HyeonCheol Yun --- go/hyperkit.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go/hyperkit.go b/go/hyperkit.go index 5352ee46..3dd2649d 100644 --- a/go/hyperkit.go +++ b/go/hyperkit.go @@ -244,7 +244,7 @@ func (h *HyperKit) checkSerials() error { return fmt.Errorf("If VM is to log to a ring buffer, StateDir must be specified") } if serial.InteractiveConsole == StdioInteractiveConsole { - if isTerminal(os.Stdout) { + if !isTerminal(os.Stdout) { return fmt.Errorf("If StdioInteractiveConsole is set, stdio must be a TTY") } if stdioConsole != -1 { @@ -618,8 +618,7 @@ func (h *HyperKit) execute() (*exec.Cmd, error) { io.Copy(os.Stdout, tty) }() } - } - if log != nil { + } else if log != nil { log.Debugf("hyperkit: Redirecting stdout/stderr to logger") stdout, err := cmd.StdoutPipe() if err != nil {