]> git.proxmox.com Git - pve-storage.git/commitdiff
diskmanage: don't set usage for unused partitions
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 6 Oct 2021 09:18:43 +0000 (11:18 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 Oct 2021 12:39:26 +0000 (14:39 +0200)
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 <f.ebner@proxmox.com>
PVE/Diskmanage.pm

index 5041fb393f20670a2c9c94223eb492a41cb52cc8..c896c5ab3a0e26a2b036e9d8bff6c89cb2e24066 100644 (file)
@@ -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 {