5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-08-03 04:21:54 +03:00

fix #6400: pci: allow other pci domains than 0000 for NVIDIA vGPUs

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>
Link: https://lore.proxmox.com/20250704061852.251189-3-d.csapak@proxmox.com
(cherry picked from commit 6c0cce85ac)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak
2025-07-04 08:18:52 +02:00
committed by Thomas Lamprecht
parent f6748361a5
commit a85370076c
2 changed files with 2 additions and 2 deletions

View File

@ -6515,7 +6515,7 @@ sub cleanup_pci_devices {
my $reservations = PVE::QemuServer::PCI::get_reservations($vmid); my $reservations = PVE::QemuServer::PCI::get_reservations($vmid);
# clean up nvidia devices # clean up nvidia devices
for my $id ($reservations->@*) { 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"; my $create_path = "/sys/bus/pci/devices/$id/nvidia/current_vgpu_type";

View File

@ -535,7 +535,7 @@ sub parse_hostpci_devices {
my sub create_nvidia_device { my sub create_nvidia_device {
my ($id, $model) = @_; 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"; my $creation = "/sys/bus/pci/devices/$id/nvidia/current_vgpu_type";