From 246232024f74797f0e1c578bc6999383e36ebcba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 7 Mar 2016 12:38:38 +0100 Subject: [PATCH] Decide whether volume is added as unused in subclass since we need the volume ID of the volume/drive/mp, which is only available after parsing, this needs to be done in the subclasses. __snapshot_delete_vol_snapshot() gets a new parameter, and pushes the volid to this array if it should be added as unused. --- src/PVE/AbstractConfig.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm index 277434d..f1c0eb2 100644 --- a/src/PVE/AbstractConfig.pm +++ b/src/PVE/AbstractConfig.pm @@ -529,7 +529,7 @@ sub snapshot_delete { return if $snapname eq 'vzdump' && $vs ne 'rootfs' && !$volume->{backup}; if (!$drivehash || $drivehash->{$vs}) { - eval { $class->__snapshot_delete_vol_snapshot($vmid, $vs, $volume, $snapname); }; + eval { $class->__snapshot_delete_vol_snapshot($vmid, $vs, $volume, $snapname, $unused); }; if (my $err = $@) { die $err if !$force; warn $err; @@ -538,7 +538,6 @@ sub snapshot_delete { # save changes (remove mp from snapshot) $class->lock_config($vmid, $updatefn, $vs) if !$force; - push @$unused, $volume->{volume}; }); # now cleanup config -- 2.39.2