]> xenbits.xensource.com Git - libvirt.git/commitdiff
virpci: Don't error on unbinded devices
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 31 Oct 2013 10:32:58 +0000 (10:32 +0000)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Nov 2013 16:28:51 +0000 (17:28 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=1018897

If a PCI deivce is not binded to any driver (e.g. there's yet no PCI
driver in the linux kernel) but still users want to passthru the device
we fail the whole operation as we fail to resolve the 'driver' link
under the PCI device sysfs tree. Obviously, this is not a fatal error
and it shouldn't be error at all.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virpci.c

index 65d716879ab62633c4765d366724f80f1085805e..148631f506975ca3864fac6a613d09b7d90cd3b3 100644 (file)
@@ -1095,11 +1095,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
     const char *newDriverName = NULL;
 
     if (virPCIDriverDir(&stubDriverPath, stubDriverName) < 0 ||
-        virPCIFile(&driverLink, dev->name, "driver") < 0 ||
-        virPCIDeviceGetDriverPathAndName(dev, &oldDriverPath,
-                                         &oldDriverName) < 0) {
+        virPCIFile(&driverLink, dev->name, "driver") < 0)
         goto cleanup;
-    }
 
     if (virFileExists(driverLink)) {
         if (virFileLinkPointsTo(driverLink, stubDriverPath)) {