public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common/qemu-server 0/2] fix #6400: allow pci domains other than 0000 for NVIDIA vGPUs
@ 2025-05-15 13:00 Dominik Csapak
  2025-05-15 13:00 ` [pve-devel] [PATCH common 1/1] sysfstools: make normalize_pci_id public Dominik Csapak
  2025-05-15 13:00 ` [pve-devel] [PATCH qemu-server 1/1] fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs Dominik Csapak
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-05-15 13:00 UTC (permalink / raw)
  To: pve-devel

by reusing the normalization of pci ids from SysFSTools

qemu-server patch depends on a pve-common patch

pve-common:

Dominik Csapak (1):
  sysfstools: make normalize_pci_id public

 src/PVE/SysFSTools.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


qemu-server:

Dominik Csapak (1):
  fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs

 PVE/QemuServer.pm     | 2 +-
 PVE/QemuServer/PCI.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Summary over all repositories:
  3 files changed, 5 insertions(+), 4 deletions(-)

-- 
Generated by git-murpp 0.8.1


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH common 1/1] sysfstools: make normalize_pci_id public
  2025-05-15 13:00 [pve-devel] [PATCH common/qemu-server 0/2] fix #6400: allow pci domains other than 0000 for NVIDIA vGPUs Dominik Csapak
@ 2025-05-15 13:00 ` Dominik Csapak
  2025-05-15 13:00 ` [pve-devel] [PATCH qemu-server 1/1] fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-05-15 13:00 UTC (permalink / raw)
  To: pve-devel

so that we can use it from other modules/packages, such as qemu-server

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/PVE/SysFSTools.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/SysFSTools.pm b/src/PVE/SysFSTools.pm
index f7acb9a..db0a607 100644
--- a/src/PVE/SysFSTools.pm
+++ b/src/PVE/SysFSTools.pm
@@ -34,11 +34,12 @@ my $parse_pci_ids = sub {
     return $ids;
 };
 
-my sub normalize_pci_id {
+# normalizes pci ids so that they're always the full id such as '0000:01:00.0'
+sub normalize_pci_id {
     my ($id) = @_;
     $id = "0000:$id" if $id !~ m/^${domainregex}:/;
     return $id;
-};
+}
 
 # returns a list of pci devices
 #
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH qemu-server 1/1] fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs
  2025-05-15 13:00 [pve-devel] [PATCH common/qemu-server 0/2] fix #6400: allow pci domains other than 0000 for NVIDIA vGPUs Dominik Csapak
  2025-05-15 13:00 ` [pve-devel] [PATCH common 1/1] sysfstools: make normalize_pci_id public Dominik Csapak
@ 2025-05-15 13:00 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-05-15 13:00 UTC (permalink / raw)
  To: pve-devel

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>
---
depends on the pve-common patch

 PVE/QemuServer.pm     | 2 +-
 PVE/QemuServer/PCI.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 577959a4..7f937a38 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6131,7 +6131,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/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm
index afb60ad2..5e74bed3 100644
--- a/PVE/QemuServer/PCI.pm
+++ b/PVE/QemuServer/PCI.pm
@@ -528,7 +528,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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-15 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-15 13:00 [pve-devel] [PATCH common/qemu-server 0/2] fix #6400: allow pci domains other than 0000 for NVIDIA vGPUs Dominik Csapak
2025-05-15 13:00 ` [pve-devel] [PATCH common 1/1] sysfstools: make normalize_pci_id public Dominik Csapak
2025-05-15 13:00 ` [pve-devel] [PATCH qemu-server 1/1] fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs Dominik Csapak

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