mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
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: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
05b28ca23d
commit
df4283a55b
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user