From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id A46701FF13C for ; Thu, 05 Mar 2026 10:17:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8F2BA1EAF1; Thu, 5 Mar 2026 10:17:51 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager 1/1] api: hardware: pci: use NVML for querying mdev information Date: Thu, 5 Mar 2026 10:16:56 +0100 Message-ID: <20260305091711.1221589-13-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260305091711.1221589-1-d.csapak@proxmox.com> References: <20260305091711.1221589-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.037 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZYSHI7Q6SGMZHTVDQPU42LBL7KOC265X X-Message-ID-Hash: ZYSHI7Q6SGMZHTVDQPU42LBL7KOC265X X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: By using the new functions in PVE::QemuServer::PCI::Mdev instead of SysFSTools. This uses now NVML for NVIDIA devices where we can get more information (namely the info we previously got from the standard mdev interface). Signed-off-by: Dominik Csapak --- PVE/API2/Hardware/PCI.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Hardware/PCI.pm b/PVE/API2/Hardware/PCI.pm index 984bb2ee..36b9741b 100644 --- a/PVE/API2/Hardware/PCI.pm +++ b/PVE/API2/Hardware/PCI.pm @@ -5,8 +5,8 @@ use warnings; use PVE::JSONSchema qw(get_standard_option); +use PVE::QemuServer::PCI::Mdev; use PVE::RESTHandler; -use PVE::SysFSTools; use base qw(PVE::RESTHandler); @@ -225,7 +225,7 @@ __PACKAGE__->register_method({ if ($param->{'pci-id-or-mapping'} =~ m/^(?:[0-9a-fA-F]{4}:)?[0-9a-fA-F]{2}:[0-9a-fA-F]{2}\.[0-9a-fA-F]$/ ) { - return PVE::SysFSTools::get_mdev_types($param->{'pci-id-or-mapping'}); # PCI ID + return PVE::QemuServer::PCI::Mdev::get_mdev_types($param->{'pci-id-or-mapping'}); # PCI ID } else { my $mapping = $param->{'pci-id-or-mapping'}; @@ -235,7 +235,7 @@ __PACKAGE__->register_method({ my $id = $device->{path}; next if $id =~ m/;/; # mdev not supported for multifunction devices - my $device_types = PVE::SysFSTools::get_mdev_types($id); + my $device_types = PVE::QemuServer::PCI::Mdev::get_mdev_types($id); for my $type_definition ($device_types->@*) { my $type = $type_definition->{type}; -- 2.47.3