From b33d7c44214126cafc3787ba64b937c9914843d7 Mon Sep 17 00:00:00 2001 From: Ashwin Gopalan Date: Thu, 17 Aug 2023 22:36:22 -0700 Subject: [PATCH 1/2] Switch Back to LegacySerial for Aarch64 When using MOS, using PCISerialDevice does not result in console output because MOS boots cdroms, thus the switch back to LegacySerial. Also overwrote the Attach of the cdrom to be virtio instead of ide for aarch64/arm64. --- pkg/api/qconfig.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/api/qconfig.go b/pkg/api/qconfig.go index c955e0c..d652923 100644 --- a/pkg/api/qconfig.go +++ b/pkg/api/qconfig.go @@ -172,10 +172,10 @@ func NewDefaultAarch64Config(name string, numCpus uint32, numMemMB uint32, sockD Memory: mem, CharDevices: []qcli.CharDevice{ qcli.CharDevice{ - Driver: qcli.PCISerialDevice, + Driver: qcli.LegacySerial, Backend: qcli.Socket, ID: "serial0", - Path: "/tmp/console.sock", + Path: filepath.Join(sockDir, "console.sock"), }, qcli.CharDevice{ Driver: qcli.LegacySerial, @@ -184,12 +184,9 @@ func NewDefaultAarch64Config(name string, numCpus uint32, numMemMB uint32, sockD Path: filepath.Join(sockDir, "monitor.sock"), }, }, - SerialDevices: []qcli.SerialDevice{ - qcli.SerialDevice{ - Driver: qcli.PCISerialDevice, - ID: "pciser0", - ChardevIDs: []string{"serial0"}, - MaxPorts: 1, + LegacySerialDevices: []qcli.LegacySerialDevice{ + qcli.LegacySerialDevice{ + ChardevID: "serial0", }, }, MonitorDevices: []qcli.MonitorDevice{ @@ -420,6 +417,11 @@ func GenerateQConfig(runDir, sockDir string, v VMDef) (*qcli.Config, error) { Type: "cdrom", ReadOnly: true, } + rt := runtime.GOARCH + if (rt == "aarch64" || rt == "arm64") { + qd.Attach = "virtio" + log.INfof("WARK: arch %s overriding cdrom Attach to virtio", rt) + } if v.Boot == "cdrom" { qd.BootIndex = "0" log.Infof("Boot from cdrom requested: bootindex=%s", qd.BootIndex) From 03fb2d0598a89854acadd615023ace83e5ff483a Mon Sep 17 00:00:00 2001 From: Ashwin Gopalan Date: Thu, 17 Aug 2023 22:48:59 -0700 Subject: [PATCH 2/2] Fixed log.Infof typo --- pkg/api/qconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/qconfig.go b/pkg/api/qconfig.go index d652923..c9fc025 100644 --- a/pkg/api/qconfig.go +++ b/pkg/api/qconfig.go @@ -420,7 +420,7 @@ func GenerateQConfig(runDir, sockDir string, v VMDef) (*qcli.Config, error) { rt := runtime.GOARCH if (rt == "aarch64" || rt == "arm64") { qd.Attach = "virtio" - log.INfof("WARK: arch %s overriding cdrom Attach to virtio", rt) + log.Infof("WARK: arch %s overriding cdrom Attach to virtio", rt) } if v.Boot == "cdrom" { qd.BootIndex = "0"