]> git.proxmox.com Git - pve-storage.git/commitdiff
diskmanage: only set mounted property for mounted devices
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 15 Jun 2022 08:42:20 +0000 (10:42 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 15 Jun 2022 08:49:22 +0000 (10:49 +0200)
instead of setting an empty string for not mounted devices

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/Diskmanage.pm

index 253916b2fdb837fd9aab4bbd7854e1c77081237c..8ed7a8b8e790dd9e1e7b4396eb4b246add12fc3c 100644 (file)
@@ -605,7 +605,6 @@ sub get_disks {
            size => $sysdata->{size},
            serial => $data->{serial},
            gpt => $data->{gpt},
-           mounted => exists $mounted->{$devpath},
            rpm => $data->{rpm},
            type =>  $type,
            wwn => $data->{wwn},
@@ -613,6 +612,7 @@ sub get_disks {
            devpath => $devpath,
            wearout => $wearout,
        };
+       $disklist->{$dev}->{mounted} = 1 if exists $mounted->{$devpath};
 
        my $by_id_link = $data->{by_id_link};
        $disklist->{$dev}->{by_id_link} = $by_id_link if defined($by_id_link);
@@ -691,7 +691,7 @@ sub get_disks {
 
            $partitions->{$part}->{devpath} = "$partpath/$part";
            $partitions->{$part}->{parent} = "$devpath";
-           $partitions->{$part}->{mounted} = exists $mounted->{"$partpath/$part"};
+           $partitions->{$part}->{mounted} = 1 if exists $mounted->{"$partpath/$part"};
            $partitions->{$part}->{gpt} = $data->{gpt};
            $partitions->{$part}->{type} = 'partition';
            $partitions->{$part}->{size} =