[pve-devel] r6300 - qemu-server/pve2/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 14 12:20:19 CEST 2011


Author: dietmar
Date: 2011-07-14 12:20:19 +0200 (Thu, 14 Jul 2011)
New Revision: 6300

Modified:
   qemu-server/pve2/PVE/QemuServer.pm
Log:
encode/decode description


Modified: qemu-server/pve2/PVE/QemuServer.pm
===================================================================
--- qemu-server/pve2/PVE/QemuServer.pm	2011-07-14 10:10:49 UTC (rev 6299)
+++ qemu-server/pve2/PVE/QemuServer.pm	2011-07-14 10:20:19 UTC (rev 6300)
@@ -1294,8 +1294,12 @@
 
 	next if $line =~ m/^\s*$/;
 
-	if ($line =~ m/^(description|args):\s*(.*\S)\s*$/) {
+	if ($line =~ m/^(description):\s*(.*\S)\s*$/) {
 	    my $key = $1;
+	    my $value = PVE::Tools::decode_text($2);
+	    $res->{$key} = $value;
+	} elsif ($line =~ m/^(args):\s*(.*\S)\s*$/) {
+	    my $key = $1;
 	    my $value = $2;
 	    $res->{$key} = $value;
 	} elsif ($line =~ m/^([a-z][a-z_]*\d*):\s*(\S+)\s*$/) {
@@ -1362,6 +1366,9 @@
 
     foreach my $key (keys %$settings) {
 	my $value = $settings->{$key};
+	if ($key eq 'description') {
+	    $value = PVE::Tools::encode_text($value);
+	}
 	eval { $value = check_type($key, $value); };
 	die "unable to parse value of '$key' - $@" if $@;
 	if ($key eq 'cdrom') {




More information about the pve-devel mailing list