提交 79d347c9 编写于 作者: M Michal Privoznik 提交者: Cole Robinson

virpci: Don't error on unbinded devices

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: NMichal Privoznik <mprivozn@redhat.com>
(cherry picked from commit df4283a5)
上级 13cfcad6
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册