add serial:1 to vmstatus when config has a serial device configured

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>
This commit is contained in:
Dominik Csapak 2018-01-26 11:57:59 +01:00 committed by Wolfgang Bumiller
parent 45cc6761db
commit 8107b378c9

View 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) = @_;