]> git.proxmox.com Git - pve-container.git/commitdiff
LXC::Config: make mountpoint_backup_enabled a class method
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 24 May 2016 08:57:45 +0000 (10:57 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 24 May 2016 10:08:23 +0000 (12:08 +0200)
All subs in there are defined as class method and the commit
which introduced this also used it as one in
PVE::VZDump::LXC and thereby broke vzdump on containers
as it passes wrong parameters to the function.

src/PVE/LXC/Config.pm

index 83e5728877b0a69774925c15c0774bdf2a85fe57..0bc20d161d0e7dfa45dc7c66a543b9185ed2d1b0 100644 (file)
@@ -45,7 +45,7 @@ sub cfs_config_path {
 }
 
 sub mountpoint_backup_enabled {
-    my ($mp_key, $mountpoint) = @_;
+    my ($class, $mp_key, $mountpoint) = @_;
 
     return 1 if $mp_key eq 'rootfs';
 
@@ -62,7 +62,7 @@ sub has_feature {
        my ($ms, $mountpoint) = @_;
 
        return if $err; # skip further test
-       return if $backup_only && !mountpoint_backup_enabled($ms, $mountpoint);
+       return if $backup_only && !$class->mountpoint_backup_enabled($ms, $mountpoint);
 
        $err = 1
            if !PVE::Storage::volume_has_feature($storecfg, $feature,
@@ -108,7 +108,7 @@ sub __snapshot_create_vol_snapshot {
     my $storecfg = PVE::Storage::config();
 
     return if $snapname eq 'vzdump' &&
-       !mountpoint_backup_enabled($ms, $mountpoint);
+       !$class->mountpoint_backup_enabled($ms, $mountpoint);
 
     PVE::Storage::volume_snapshot($storecfg, $mountpoint->{volume}, $snapname);
 }