[pve-devel] [PATCH qemu-server 1/1] add serial:1 to vmstatus when config has a serial device configured

Dominik Csapak d.csapak at proxmox.com
Fri Jan 26 11:57:59 CET 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/QemuServer.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 63d7155..9c0de45 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2668,6 +2668,8 @@ sub vmstatus {
 
         $d->{template} = PVE::QemuConfig->is_template($conf);
 
+	$d->{serial} = 1 if conf_has_serial($conf);
+
 	$res->{$vmid} = $d;
     }
 
@@ -2862,6 +2864,18 @@ sub foreach_volid {
     }
 }
 
+sub conf_has_serial {
+    my ($conf) = @_;
+
+    for (my $i = 0; $i < $MAX_SERIAL_PORTS; $i++)  {
+	if ($conf->{"serial$i"}) {
+	    return 1;
+	}
+    }
+
+    return 0;
+}
+
 sub vga_conf_has_spice {
     my ($vga) = @_;
 
-- 
2.11.0





More information about the pve-devel mailing list