]> git.proxmox.com Git - pve-common.git/commitdiff
Decide whether volume is added as unused in subclass
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 7 Mar 2016 11:38:38 +0000 (12:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 8 Mar 2016 10:33:28 +0000 (11:33 +0100)
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

index 277434d04cf0d30acbc84793f462df51a46ba8b2..f1c0eb2f431f6ee50f1f62e9cc0a75ff0496cea8 100644 (file)
@@ -529,7 +529,7 @@ sub snapshot_delete {
 
        return if $snapname eq 'vzdump' && $vs ne 'rootfs' && !$volume->{backup};
        if (!$drivehash || $drivehash->{$vs}) {
 
        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;
            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;
 
        # save changes (remove mp from snapshot)
        $class->lock_config($vmid, $updatefn, $vs) if !$force;
-       push @$unused, $volume->{volume};
     });
 
     # now cleanup config
     });
 
     # now cleanup config