mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-15 10:03:40 +00:00
SysFSTools: get name from mediated device types
Some vendors also provide a 'name' file here for the type, which, in case of NVIDIA, is the official name for the vGPU type in their documentation, so extract and return it too (if it exists). Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
2e8331ba22
commit
0fbcf73656
@ -172,11 +172,16 @@ sub get_mdev_types {
|
|||||||
my $available = int(file_read_firstline("$type_path/available_instances"));
|
my $available = int(file_read_firstline("$type_path/available_instances"));
|
||||||
my $description = PVE::Tools::file_get_contents("$type_path/description");
|
my $description = PVE::Tools::file_get_contents("$type_path/description");
|
||||||
|
|
||||||
push @$types, {
|
my $entry = {
|
||||||
type => $type,
|
type => $type,
|
||||||
description => $description,
|
description => $description,
|
||||||
available => $available,
|
available => $available,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
my $name = file_read_firstline("$type_path/name");
|
||||||
|
$entry->{name} = $name if defined($name);
|
||||||
|
|
||||||
|
push @$types, $entry;
|
||||||
});
|
});
|
||||||
|
|
||||||
return $types;
|
return $types;
|
||||||
|
Loading…
Reference in New Issue
Block a user