Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions pkg/api/qconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a stand-alone fix. Let's put this in as it's own PR.

},
qcli.CharDevice{
Driver: qcli.LegacySerial,
Expand All @@ -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",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go the PR with the console path fix.

},
},
MonitorDevices: []qcli.MonitorDevice{
Expand Down Expand Up @@ -420,6 +417,11 @@ func GenerateQConfig(runDir, sockDir string, v VMDef) (*qcli.Config, error) {
Type: "cdrom",
ReadOnly: true,
}
rt := runtime.GOARCH
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

if (rt == "aarch64" || rt == "arm64") {
qd.Attach = "virtio"
log.Infof("WARK: arch %s overriding cdrom Attach to virtio", rt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Infof("WARK: arch %s overriding cdrom Attach to virtio", rt)

Let's drop this

}
if v.Boot == "cdrom" {
qd.BootIndex = "0"
log.Infof("Boot from cdrom requested: bootindex=%s", qd.BootIndex)
Expand Down