]> git.proxmox.com Git - qemu-server.git/commitdiff
add serial:1 to vmstatus when config has a serial device configured
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 26 Jan 2018 10:57:59 +0000 (11:57 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 30 Jan 2018 15:36:38 +0000 (16:36 +0100)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/QemuServer.pm

index 63d7155b3aadf484f0b8324c944ab3a5072324ef..9c0de45e6221f89a5492a10208f822b100a7c4d2 100644 (file)
@@ -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) = @_;