[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
Wed Jan 3 13:04:11 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 42c412a..3d9b9dd 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2645,6 +2645,8 @@ sub vmstatus {
 
         $d->{template} = PVE::QemuConfig->is_template($conf);
 
+	$d->{serial} = 1 if conf_has_serial($conf);
+
 	$res->{$vmid} = $d;
     }
 
@@ -2839,6 +2841,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