[pve-devel] [PATCH manager 2/2] VZDump: remove dead code

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Apr 14 10:34:43 CEST 2016


remove get_lvm_mapping and get_lvm_device, which are not
used anywhere anymore.
---
 PVE/VZDump.pm | 43 -------------------------------------------
 1 file changed, 43 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index d002fe7..bb2ef07 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -582,33 +582,6 @@ sub new {
 
 }
 
-sub get_lvm_mapping {
-
-    my $devmapper;
-
-    my $cmd = ['lvs', '--units', 'm', '--separator', ':', '--noheadings',
-	       '-o', 'vg_name,lv_name,lv_size' ];
-
-    my $parser = sub {
-	my $line = shift;
-	if ($line =~ m|^\s*(\S+):(\S+):(\d+(\.\d+))[Mm]$|) {
-	    my $vg = $1;
-	    my $lv = $2;
-	    $devmapper->{"/dev/$vg/$lv"} = [$vg, $lv];
-	    my $qlv = $lv;
-	    $qlv =~ s/-/--/g;
-	    my $qvg = $vg;
-	    $qvg =~ s/-/--/g;
-	    $devmapper->{"/dev/mapper/$qvg-$qlv"} = [$vg, $lv];
-	}			
-    };
-
-    eval { PVE::Tools::run_command($cmd, errfunc => sub {}, outfunc => $parser); };
-    warn $@ if $@;
-
-    return $devmapper;
-}
-
 sub get_mount_info {
     my ($dir) = @_;
 
@@ -636,22 +609,6 @@ sub get_mount_info {
     return $res;
 }
 
-sub get_lvm_device {
-    my ($dir, $mapping) = @_;
-
-    my $info = get_mount_info($dir);
-
-    return undef if !$info;
-   
-    my $dev = $info->{device};
-
-    my ($vg, $lv);
-
-    ($vg, $lv) = @{$mapping->{$dev}} if defined $mapping->{$dev};
-
-    return wantarray ? ($dev, $info->{mountpoint}, $vg, $lv, $info->{fstype}) : $dev;
-}
-
 sub getlock {
     my ($self, $upid) = @_;
 
-- 
2.1.4





More information about the pve-devel mailing list