From: Dominik Csapak Date: Mon, 30 Jul 2018 08:26:02 +0000 (+0200) Subject: extend list_thinpools for multiple vgs and more information X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=49d149e638c27ca199f61959dbef9c6f1dec3d32;p=pve-storage.git extend list_thinpools for multiple vgs and more information 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 --- diff --git a/PVE/Storage/LvmThinPlugin.pm b/PVE/Storage/LvmThinPlugin.pm index db25ee3..d08eb77 100644 --- a/PVE/Storage/LvmThinPlugin.pm +++ b/PVE/Storage/LvmThinPlugin.pm @@ -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;