[pve-devel] [PATCH common v3 1/3] SysFSTools: make mdev cleanup independent of pciid

Dominik Csapak d.csapak at proxmox.com
Tue Sep 20 14:50:13 CEST 2022


mediated devices also appear under /sys/bus/mdev/devices with their
uuid, independent of the pci device, so we can use that instead

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

diff --git a/src/PVE/SysFSTools.pm b/src/PVE/SysFSTools.pm
index b4cd5cc..b95e934 100644
--- a/src/PVE/SysFSTools.pm
+++ b/src/PVE/SysFSTools.pm
@@ -367,11 +367,9 @@ sub pci_create_mdev_device {
 }
 
 sub pci_cleanup_mdev_device {
-    my ($pciid, $uuid) = @_;
+    my ($uuid) = @_;
 
-    $pciid = normalize_pci_id($pciid);
-
-    my $basedir = "$pcisysfs/devices/$pciid/$uuid";
+    my $basedir = "/sys/bus/mdev/devices/$uuid";
 
     if (! -e $basedir) {
 	return 1; # no cleanup necessary if it does not exist
-- 
2.30.2






More information about the pve-devel mailing list