提交 df4283a5 编写于 作者: M Michal Privoznik

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>
上级 05b28ca2
......@@ -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.
先完成此消息的编辑!
想要评论请 注册