[pve-devel] [PATCH 3/3] snapshot_delete: reorder parent "connection" after prepare

Stefan Priebe s.priebe at profihost.ag
Fri Jul 4 10:25:49 CEST 2014


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 PVE/QemuServer.pm |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index db0e206..ed46df1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4935,10 +4935,12 @@ sub snapshot_delete {
 	die "snapshot '$snapname' does not exist\n" if !defined($snap);
 
 	# remove parent refs
-	&$unlink_parent($conf, $snap->{parent});
-	foreach my $sn (keys %{$conf->{snapshots}}) {
-	    next if $sn eq $snapname;
-	    &$unlink_parent($conf->{snapshots}->{$sn}, $snap->{parent});
+	if (!$prepare) {
+	    &$unlink_parent($conf, $snap->{parent});
+	    foreach my $sn (keys %{$conf->{snapshots}}) {
+		next if $sn eq $snapname;
+		&$unlink_parent($conf->{snapshots}->{$sn}, $snap->{parent});
+	    }
 	}
 
 	if ($remove_drive) {
-- 
1.7.10.4




More information about the pve-devel mailing list