[pve-devel] [PATCH v2 qemu-server] fix 'uninitialized value in concat' due to unnamed VM

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Aug 27 14:56:36 CEST 2015


This is an minor fix which let's you start the spice console on an
unnamed VM without getting the 'Use of uninitialized value in
concatenation' error.
Also changes the trailing comma from the $conf definition lineto an
semicolon.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Changes since v1:
* add spaces and hyphen when a VM name is defined only

 PVE/API2/Qemu.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 0dd413b..b340eae 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1397,7 +1397,8 @@ __PACKAGE__->register_method({
 	my $proxy = $param->{proxy};
 
 	my $conf = PVE::QemuServer::load_config($vmid, $node);
-	my $title = "VM $vmid - $conf->{'name'}",
+	my $title = "VM $vmid";
+	$title .= " - ". $conf->{name} if $conf->{name};
 
 	my $port = PVE::QemuServer::spice_port($vmid);
 
-- 
2.1.4




More information about the pve-devel mailing list