@@ -789,24 +789,19 @@ func Cmdline(cfg Config) (string, []string, error) {
789
789
args = append (args , "-device" , "virtio-keyboard-pci" )
790
790
args = append (args , "-device" , "virtio-mouse-pci" )
791
791
args = append (args , "-device" , "qemu-xhci,id=usb-bus" )
792
- case limayaml .AARCH64 :
793
- // QEMU does not seem to support virtio-vga for aarch64
792
+ case limayaml .AARCH64 , limayaml . ARMV7L :
793
+ // QEMU does not seem to support virtio-vga for aarch64 and arm
794
794
args = append (args , "-vga" , "none" , "-device" , "ramfb" )
795
795
args = append (args , "-device" , "qemu-xhci,id=usb-bus" )
796
796
args = append (args , "-device" , "usb-kbd,bus=usb-bus.0" )
797
797
args = append (args , "-device" , "usb-mouse,bus=usb-bus.0" )
798
- case limayaml .ARMV7L :
799
- // QEMU does not seem to support virtio-vga for arm
800
- args = append (args , "-vga" , "cirrus" , "-device" , "cirrus-vga" )
801
- args = append (args , "-device" , "qemu-xhci,id=usb-bus" )
802
- args = append (args , "-device" , "usb-kbd,bus=usb-bus.0" )
803
- args = append (args , "-device" , "usb-mouse,bus=usb-bus.0" )
804
798
}
805
799
806
800
// Parallel
807
801
args = append (args , "-parallel" , "none" )
808
802
809
- // Serial (legacy)
803
+ // Serial (default)
804
+ // This is ttyS0 for Intel and RISC-V, ttyAMA0 for ARM.
810
805
serialSock := filepath .Join (cfg .InstanceDir , filenames .SerialSock )
811
806
if err := os .RemoveAll (serialSock ); err != nil {
812
807
return "" , nil , err
@@ -819,6 +814,24 @@ func Cmdline(cfg Config) (string, []string, error) {
819
814
args = append (args , "-chardev" , fmt .Sprintf ("socket,id=%s,path=%s,server=on,wait=off,logfile=%s" , serialChardev , serialSock , serialLog ))
820
815
args = append (args , "-serial" , "chardev:" + serialChardev )
821
816
817
+ // Serial (PCI, ARM only)
818
+ // On ARM, the default serial is ttyAMA0, this PCI serial is ttyS0.
819
+ // https://gitlab.com/qemu-project/qemu/-/issues/1801#note_1494720586
820
+ switch * y .Arch {
821
+ case limayaml .AARCH64 , limayaml .ARMV7L :
822
+ serialpSock := filepath .Join (cfg .InstanceDir , filenames .SerialPCISock )
823
+ if err := os .RemoveAll (serialpSock ); err != nil {
824
+ return "" , nil , err
825
+ }
826
+ serialpLog := filepath .Join (cfg .InstanceDir , filenames .SerialPCILog )
827
+ if err := os .RemoveAll (serialpLog ); err != nil {
828
+ return "" , nil , err
829
+ }
830
+ const serialpChardev = "char-serial-pci"
831
+ args = append (args , "-chardev" , fmt .Sprintf ("socket,id=%s,path=%s,server=on,wait=off,logfile=%s" , serialpChardev , serialpSock , serialpLog ))
832
+ args = append (args , "-device" , "pci-serial,chardev=" + serialpChardev )
833
+ }
834
+
822
835
// Serial (virtio)
823
836
serialvSock := filepath .Join (cfg .InstanceDir , filenames .SerialVirtioSock )
824
837
if err := os .RemoveAll (serialvSock ); err != nil {
0 commit comments