From 0fbcf73656a86e75acac7a008621e5da193b21a7 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 12 Aug 2022 11:29:48 +0200 Subject: [PATCH] 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 --- src/PVE/SysFSTools.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/SysFSTools.pm b/src/PVE/SysFSTools.pm index ac48f2c..b4cd5cc 100644 --- a/src/PVE/SysFSTools.pm +++ b/src/PVE/SysFSTools.pm @@ -172,11 +172,16 @@ sub get_mdev_types { my $available = int(file_read_firstline("$type_path/available_instances")); my $description = PVE::Tools::file_get_contents("$type_path/description"); - push @$types, { + my $entry = { type => $type, description => $description, available => $available, }; + + my $name = file_read_firstline("$type_path/name"); + $entry->{name} = $name if defined($name); + + push @$types, $entry; }); return $types; -- 2.39.5