From d7856be59ec0832ca4b2efccb2218e6ef5e33b70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 17 Jun 2020 10:41:17 +0200 Subject: [PATCH] properly parse 'vga' for termproxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'vga' is a property string, we can't just assume it starts with the default key's value here either. Signed-off-by: Fabian Grünbichler --- PVE/API2/Qemu.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 9cfaa29f..59f91618 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1779,8 +1779,9 @@ __PACKAGE__->register_method({ my $conf = PVE::QemuConfig->load_config($vmid, $node); # check if VM exists if (!defined($serial)) { - if ($conf->{vga} && $conf->{vga} =~ m/^serial\d+$/) { - $serial = $conf->{vga}; + if ($conf->{vga}) { + my $vga = PVE::QemuServer::parse_vga($conf->{vga}); + $serial = $vga->{type} if $vga->{type} =~ m/^serial\d+$/; } }