From 49d149e638c27ca199f61959dbef9c6f1dec3d32 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 30 Jul 2018 10:26:02 +0200 Subject: [PATCH] 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 --- PVE/Storage/LvmThinPlugin.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; -- 2.39.5