5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-01-24 02:04:13 +03:00

diskmanage: add mounted_paths

returns a list of mounted paths with the backing devices

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Aaron Lauterer 2022-08-19 17:01:19 +02:00 committed by Fabian Grünbichler
parent 6a44cc417d
commit 4de6002558

View File

@ -499,6 +499,19 @@ sub mounted_blockdevs {
return $mounted;
}
# returns hashmap of abs mount path -> first part of /proc/mounts (what)
sub mounted_paths {
my $mounted = {};
my $mounts = PVE::ProcFSTools::parse_proc_mounts();
foreach my $mount (@$mounts) {
$mounted->{abs_path($mount->[1])} = $mount->[0];
};
return $mounted;
}
sub get_disks {
my ($disks, $nosmart, $include_partitions) = @_;
my $disklist = {};