platform/qemu: Save console log to instance directory
@@ -143,6 +143,7 @@ func (qc *Cluster) NewMachine(cfg string) (platform.Machine, error) {
panic(qc.conf.Board)
}
+ consolePath := filepath.Join(dir, "console.txt")
qmMac := qm.netif.HardwareAddr.String()
qmCmd = append(qmCmd,
"-bios", qc.conf.BIOSImage,
@@ -155,6 +156,8 @@ func (qc *Cluster) NewMachine(cfg string) (platform.Machine, error) {
"-device", qc.virtio("blk", "drive=blk"),
"-netdev", "tap,id=tap,fd=3",
"-device", qc.virtio("net", "netdev=tap,mac="+qmMac),
+ "-chardev", "file,id=log,path="+consolePath,
+ "-serial", "chardev:log",
)
if conf.IsIgnition() {
