render / rpms / libvirt

Forked from rpms/libvirt 12 months ago
Clone
3db603
From df4283a55bf3516b333352e2052dbe3317936953 Mon Sep 17 00:00:00 2001
3db603
Message-Id: <df4283a55bf3516b333352e2052dbe3317936953.1384267031.git.crobinso@redhat.com>
3db603
From: Michal Privoznik <mprivozn@redhat.com>
3db603
Date: Thu, 31 Oct 2013 10:32:58 +0000
3db603
Subject: [PATCH] virpci: Don't error on unbinded devices
3db603
3db603
https://bugzilla.redhat.com/show_bug.cgi?id=1018897
3db603
3db603
If a PCI deivce is not binded to any driver (e.g. there's yet no PCI
3db603
driver in the linux kernel) but still users want to passthru the device
3db603
we fail the whole operation as we fail to resolve the 'driver' link
3db603
under the PCI device sysfs tree. Obviously, this is not a fatal error
3db603
and it shouldn't be error at all.
3db603
3db603
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3db603
---
3db603
 src/util/virpci.c | 5 +----
3db603
 1 file changed, 1 insertion(+), 4 deletions(-)
3db603
3db603
diff --git a/src/util/virpci.c b/src/util/virpci.c
3db603
index 65d7168..148631f 100644
3db603
--- a/src/util/virpci.c
3db603
+++ b/src/util/virpci.c
3db603
@@ -1095,11 +1095,8 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev,
3db603
     const char *newDriverName = NULL;
3db603
 
3db603
     if (virPCIDriverDir(&stubDriverPath, stubDriverName) < 0 ||
3db603
-        virPCIFile(&driverLink, dev->name, "driver") < 0 ||
3db603
-        virPCIDeviceGetDriverPathAndName(dev, &oldDriverPath,
3db603
-                                         &oldDriverName) < 0) {
3db603
+        virPCIFile(&driverLink, dev->name, "driver") < 0)
3db603
         goto cleanup;
3db603
-    }
3db603
 
3db603
     if (virFileExists(driverLink)) {
3db603
         if (virFileLinkPointsTo(driverLink, stubDriverPath)) {
3db603
-- 
3db603
1.8.4.2
3db603