Switch Back to LegacySerial for Aarch64#23
Switch Back to LegacySerial for Aarch64#23ashwing123 wants to merge 2 commits intoproject-machine:mainfrom
Conversation
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.
raharper
left a comment
There was a problem hiding this comment.
Let's split this into two PRs.
- Fix up console path and virtio-cdrom
This enables the cloud image to work.
Then, a second pr introducing the legacy serial device. This second PR may require
an update to qcli so we emit both -serial <something> and the -device pci-serial,...
Further, this second PR will need some machine console and api changes to enumerate and allow selecting which console the command attaches.
| MaxPorts: 1, | ||
| LegacySerialDevices: []qcli.LegacySerialDevice{ | ||
| qcli.LegacySerialDevice{ | ||
| ChardevID: "serial0", |
There was a problem hiding this comment.
I think we're going to want both; in case someone boots an image using console=ttyS0, and a different image with console=ttyAMA0.
I think we can fix this in qcli though; that is, if we use the PCISerialDevice and set Legacy, we should get:
-serial stdio \
-chardev socket,id=serial1,path=/tmp/console.sock,server=on,wait=off
-device pci-serial,id=pciser0,chardev=serial1
Then we can have both -- this does mean that machine console will need some enhancement so one can select the different serial devices attached. But that's OK.
There was a problem hiding this comment.
This can go the PR with the console path fix.
| Backend: qcli.Socket, | ||
| ID: "serial0", | ||
| Path: "/tmp/console.sock", | ||
| Path: filepath.Join(sockDir, "console.sock"), |
There was a problem hiding this comment.
This is a stand-alone fix. Let's put this in as it's own PR.
| rt := runtime.GOARCH | ||
| if (rt == "aarch64" || rt == "arm64") { | ||
| qd.Attach = "virtio" | ||
| log.Infof("WARK: arch %s overriding cdrom Attach to virtio", rt) |
There was a problem hiding this comment.
| log.Infof("WARK: arch %s overriding cdrom Attach to virtio", rt) |
Let's drop this
| Type: "cdrom", | ||
| ReadOnly: true, | ||
| } | ||
| rt := runtime.GOARCH |
There was a problem hiding this comment.
| rt := runtime.GOARCH | |
| rt := runtime.GOARCH | |
| // the aarch64 qemu virtual machine does not attach an IDE/AHCI adapter to the machine by default | |
| // and the `cdrom` setting machine.yaml will introduce an IDE device unless we specify it to be a virtio-blk-cdrom |
When using MOS, using PCISerialDevice does not result in console output because MOS boots cdroms. Thus we switch back to LegacySerial as this permits console outputs. Also overwrote the Attach of the cdrom to be virtio instead of ide for aarch64/arm64 for console capabilities.