From ff91cfae35a7530472c2e67f9470c932b9ce8324 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Wed, 6 Oct 2021 11:18:43 +0200 Subject: [PATCH] diskmanage: don't set usage for unused partitions The disk type is already 'partition' so there's no additional information here. And it would need to serve as a code-word for unused partitions. The cleaner approach is to not set the usage. Signed-off-by: Fabian Ebner --- PVE/Diskmanage.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index 5041fb3..c896c5a 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -661,7 +661,7 @@ sub get_disks { # for devices, this check is done explicitly later return 'Device Mapper' if !dir_is_empty("$sysdir/holders"); - return 'partition'; + return; # unused partition }; my $collect_ceph_info = sub { @@ -730,7 +730,6 @@ sub get_disks { my $used = $determine_usage->($devpath, $sysdir, 0); if (!$include_partitions) { foreach my $part (sort keys %{$partitions}) { - next if $partitions->{$part}->{used} eq 'partition'; $used //= $partitions->{$part}->{used}; } } else {