[pve-devel] [PATCH qemu-server 10/13] arm: use UART for serial0 instead of a separate device

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Oct 24 10:56:46 CEST 2018


Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 PVE/QemuServer.pm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 95f3f42..cf48857 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3463,7 +3463,14 @@ sub config_to_command {
 	    if ($path eq 'socket') {
 		my $socket = "/var/run/qemu-server/${vmid}.serial$i";
 		push @$devices, '-chardev', "socket,id=serial$i,path=$socket,server,nowait";
-		push @$devices, '-device', "isa-serial,chardev=serial$i";
+		# On arm64, serial0 is the UART device. Qemu only allows
+		# connecting UART devices via the '-serial' command line, as
+		# the device has a fixed slot on the hardware...
+		if ($arch eq 'arm64' && $i == 0) {
+		    push @$devices, '-serial', "chardev:serial$i";
+		} else {
+		    push @$devices, '-device', "isa-serial,chardev=serial$i";
+		}
 	    } else {
 		die "no such serial device\n" if ! -c $path;
 		push @$devices, '-chardev', "tty,id=serial$i,path=$path";
-- 
2.11.0





More information about the pve-devel mailing list