api2: disks: add mounted boolean field
... and remove '(mounted)' from usage string Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
committed by
Wolfgang Bumiller
parent
a1528ffe8f
commit
76c98d2353
@ -125,6 +125,7 @@ __PACKAGE__->register_method ({
|
|||||||
},
|
},
|
||||||
used => { type => 'string', optional => 1 },
|
used => { type => 'string', optional => 1 },
|
||||||
gpt => { type => 'boolean' },
|
gpt => { type => 'boolean' },
|
||||||
|
mounted => { type => 'boolean' },
|
||||||
size => { type => 'integer'},
|
size => { type => 'integer'},
|
||||||
osdid => { type => 'integer'},
|
osdid => { type => 'integer'},
|
||||||
vendor => { type => 'string', optional => 1 },
|
vendor => { type => 'string', optional => 1 },
|
||||||
|
|||||||
@ -605,6 +605,7 @@ sub get_disks {
|
|||||||
size => $sysdata->{size},
|
size => $sysdata->{size},
|
||||||
serial => $data->{serial},
|
serial => $data->{serial},
|
||||||
gpt => $data->{gpt},
|
gpt => $data->{gpt},
|
||||||
|
mounted => exists $mounted->{$devpath},
|
||||||
rpm => $data->{rpm},
|
rpm => $data->{rpm},
|
||||||
type => $type,
|
type => $type,
|
||||||
wwn => $data->{wwn},
|
wwn => $data->{wwn},
|
||||||
@ -650,10 +651,7 @@ sub get_disks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $fstype = $info->{fstype};
|
my $fstype = $info->{fstype};
|
||||||
if (defined($fstype)) {
|
return "${fstype}" if defined($fstype);
|
||||||
return "${fstype} (mounted)" if $mounted->{$devpath};
|
|
||||||
return "${fstype}";
|
|
||||||
}
|
|
||||||
return 'mounted' if $mounted->{$devpath};
|
return 'mounted' if $mounted->{$devpath};
|
||||||
|
|
||||||
return if !$is_partition;
|
return if !$is_partition;
|
||||||
@ -693,6 +691,7 @@ sub get_disks {
|
|||||||
|
|
||||||
$partitions->{$part}->{devpath} = "$partpath/$part";
|
$partitions->{$part}->{devpath} = "$partpath/$part";
|
||||||
$partitions->{$part}->{parent} = "$devpath";
|
$partitions->{$part}->{parent} = "$devpath";
|
||||||
|
$partitions->{$part}->{mounted} = exists $mounted->{"$partpath/$part"};
|
||||||
$partitions->{$part}->{gpt} = $data->{gpt};
|
$partitions->{$part}->{gpt} = $data->{gpt};
|
||||||
$partitions->{$part}->{type} = 'partition';
|
$partitions->{$part}->{type} = 'partition';
|
||||||
$partitions->{$part}->{size} =
|
$partitions->{$part}->{size} =
|
||||||
|
|||||||
Reference in New Issue
Block a user