[pve-devel] [PATCH] QemuServer: fix wrong binding of pci root ports, bridges or switches to vfio

Stefan Priebe s.priebe at profihost.ag
Sun Feb 1 20:46:46 CET 2015


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 PVE/QemuServer.pm |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 7045c14..04db8a6 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4598,6 +4598,11 @@ sub pci_dev_group_bind_to_vfio {
 
     foreach my $pciid (@devs) {
 	$pciid =~ m/^([:\.\da-f]+)$/ or die "PCI ID $pciid not valid!\n";
+
+        # pci bridges, switches or root ports are not supported
+        # they have a pci_bus subdirectory so skip them
+        next if (-e "$pcisysfs/devices/$pciid/pci_bus");
+
 	my $info = pci_device_info($1);
 	pci_dev_bind_to_vfio($info) || die "Cannot bind $pciid to vfio\n";
     }
-- 
1.7.10.4




More information about the pve-devel mailing list