public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v2 1/1] fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs
Date: Fri,  4 Jul 2025 08:18:52 +0200	[thread overview]
Message-ID: <20250704061852.251189-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250704061852.251189-1-d.csapak@proxmox.com>

when creating or cleaning up NVIDIA vGPUs, we mistakenly assumed a
PCI domain of 0000, but this might be different.

Use 'normalize_pci_id' from PVE::SysFSTools, which handles this already
correctly.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/PVE/QemuServer.pm     | 2 +-
 src/PVE/QemuServer/PCI.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 92c8fad6..d36fd1d0 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -5882,7 +5882,7 @@ sub cleanup_pci_devices {
     my $reservations = PVE::QemuServer::PCI::get_reservations($vmid);
     # clean up nvidia devices
     for my $id ($reservations->@*) {
-        $id = '0000:' . $id if $id !~ m/^0000:/;
+        $id = PVE::SysFSTools::normalize_pci_id($id);
 
         my $create_path = "/sys/bus/pci/devices/$id/nvidia/current_vgpu_type";
 
diff --git a/src/PVE/QemuServer/PCI.pm b/src/PVE/QemuServer/PCI.pm
index ddf2f028..b713f532 100644
--- a/src/PVE/QemuServer/PCI.pm
+++ b/src/PVE/QemuServer/PCI.pm
@@ -540,7 +540,7 @@ sub parse_hostpci_devices {
 my sub create_nvidia_device {
     my ($id, $model) = @_;
 
-    $id = '0000:' . $id if $id !~ m/^0000:/;
+    $id = PVE::SysFSTools::normalize_pci_id($id);
 
     my $creation = "/sys/bus/pci/devices/$id/nvidia/current_vgpu_type";
 
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-07-04  6:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-04  6:18 [pve-devel] [PATCH common/qemu-server v2 0/2] fix #6400: allow pci domains other " Dominik Csapak
2025-07-04  6:18 ` [pve-devel] [PATCH common v2 1/1] sysfstools: make normalize_pci_id public Dominik Csapak
2025-07-04  6:18 ` Dominik Csapak [this message]
2025-07-10 11:24 ` [pve-devel] applied-series: [PATCH common/qemu-server v2 0/2] fix #6400: allow pci domains other than 0000 for NVIDIA vGPUs Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250704061852.251189-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal