]> git.proxmox.com Git - pve-storage.git/commitdiff
extend list_thinpools for multiple vgs and more information
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 30 Jul 2018 08:26:02 +0000 (10:26 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 2 Aug 2018 09:10:33 +0000 (11:10 +0200)
if no vg is given, give back all thinpools from all vgs
if verbose is 1, then give back the information about the thinpools
(like size and free)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Storage/LvmThinPlugin.pm

index db25ee3bd6992b8a1a2859be6028c9a085b1d07f..d08eb7777f4d6393e8d2956cad29c16fe6fe9800 100644 (file)
@@ -180,9 +180,13 @@ sub list_thinpools {
     my $lvs = PVE::Storage::LVMPlugin::lvm_list_volumes($vg);
     my $thinpools = [];
 
-    foreach my $lvname (keys %{$lvs->{$vg}}) {
-       next if $lvs->{$vg}->{$lvname}->{lv_type} ne 't';
-       push @$thinpools, { lv => $lvname };
+    foreach my $vg (keys %$lvs) {
+       foreach my $lvname (keys %{$lvs->{$vg}}) {
+           next if $lvs->{$vg}->{$lvname}->{lv_type} ne 't';
+           my $lv = $lvs->{$vg}->{$lvname};
+           $lv->{lv} = $lvname;
+           push @$thinpools, $lv;
+       }
     }
 
     return $thinpools;