From: Dominik Csapak Date: Fri, 26 Jan 2018 10:57:59 +0000 (+0100) Subject: add serial:1 to vmstatus when config has a serial device configured X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8107b378c996e498c5ed775beadea48295101f8b;hp=45cc6761db6b89ae996bdefad539da0929c05a11;p=qemu-server.git add serial:1 to vmstatus when config has a serial device configured Signed-off-by: Dominik Csapak Reviewed-by: Thomas Lamprecht Tested-by: Thomas Lamprecht Acked-by: Wolfgang Bumiller --- 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) = @_;