[pve-devel] [PATCH v4 02/14] parse_vm_config: correctly handle $descr

Dietmar Maurer dietmar at proxmox.com
Fri Nov 21 11:46:14 CET 2014


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/QemuServer.pm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 8f9a36c..35ca395 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1782,7 +1782,7 @@ sub parse_vm_config {
     my $res = {
 	digest => Digest::SHA::sha1_hex($raw),
 	snapshots => {},
-	pending => {}
+	pending => {},
     };
 
     $filename =~ m|/qemu-server/(\d+)\.conf$|
@@ -1798,10 +1798,12 @@ sub parse_vm_config {
 	next if $line =~ m/^\s*$/;
 
 	if ($line =~ m/^\[PENDING\]\s*$/i) {
+	    $conf->{description} = $descr if $descr;
+	    $descr = '';
 	    $conf = $res->{pending} = {};
 	    next;
 
-	}elsif ($line =~ m/^\[([a-z][a-z0-9_\-]+)\]\s*$/i) {
+	} elsif ($line =~ m/^\[([a-z][a-z0-9_\-]+)\]\s*$/i) {
 	    my $snapname = $1;
 	    $conf->{description} = $descr if $descr;
 	    $descr = '';
-- 
1.7.10.4




More information about the pve-devel mailing list