Add console mode to podman machine

Add the functionality for a console to be dipslayed when the user runs
`podman --log-level debug machine start` on MacOS. This mimics the
behavior that currently exists on Linux.

[NO NEW TESTS NEEDED]

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
This commit is contained in:
Jake Correnti
2023-06-07 17:00:18 -04:00
parent c99d42b8e4
commit 65e5d2773d

View File

@ -22,6 +22,9 @@ func getDefaultDevices(imagePath, logPath string) []string {
"virtio-net,nat,mac=72:20:43:d4:38:62",
fmt.Sprintf("virtio-blk,path=%s", imagePath),
fmt.Sprintf("virtio-serial,logFilePath=%s", logPath),
fmt.Sprintf("virtio-input,pointing"),
fmt.Sprintf("virtio-input,keyboard"),
fmt.Sprintf("virtio-gpu"),
}
return defaultDevices
}
@ -68,6 +71,9 @@ func (vf *VfkitHelper) toCmdLine(cpus, memory string) []string {
// we can leave it as optional.
//"--log-level", "debug",
}
if vf.LogLevel == logrus.DebugLevel {
cmd = append(cmd, "--gui")
}
for _, d := range vf.Devices {
cmd = append(cmd, "--device", d)
}