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 5C8001FF13C for ; Thu, 02 Apr 2026 13:22:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D544A140BF; Thu, 2 Apr 2026 13:22:46 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 1/1] api: hardware: pci: use NVML for querying mdev information Date: Thu, 2 Apr 2026 13:22:03 +0200 Message-ID: <20260402112212.2294356-5-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260402112212.2294356-1-d.csapak@proxmox.com> References: <20260402112212.2294356-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.456 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: FG2PZ72B7HPX6QTA225DDGRGBIGUZOXT X-Message-ID-Hash: FG2PZ72B7HPX6QTA225DDGRGBIGUZOXT 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 --- NOTE: needs a bumped qemu-server version dependency in d/control 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