if (!driver) {
/* The device is not bound to any driver and we are almost done. */
+ VIR_DEBUG("PCI device %s is not bound to any driver", dev->name);
goto reprobe;
}
- if (!dev->unbind_from_stub)
+ if (!dev->unbind_from_stub) {
+ VIR_DEBUG("Unbind from stub skipped for PCI device %s", dev->name);
goto remove_slot;
+ }
/* If the device isn't bound to a known stub, skip the unbind. */
if (virPCIStubDriverTypeFromString(driver) < 0 ||
- virPCIStubDriverTypeFromString(driver) == VIR_PCI_STUB_DRIVER_NONE)
+ virPCIStubDriverTypeFromString(driver) == VIR_PCI_STUB_DRIVER_NONE) {
+ VIR_DEBUG("Unbind from stub skipped for PCI device %s because of "
+ "unknown stub driver", dev->name);
goto remove_slot;
+ }
- VIR_DEBUG("Found stub driver %s", driver);
+ VIR_DEBUG("Unbinding PCI device %s from stub driver %s",
+ dev->name, driver);
if (virPCIDeviceUnbind(dev) < 0)
goto cleanup;
dev->unbind_from_stub = false;
remove_slot:
- if (!dev->remove_slot)
+ if (!dev->remove_slot) {
+ VIR_DEBUG("Slot removal skipped for PCI device %s", dev->name);
goto reprobe;
+ }
+
+ VIR_DEBUG("Removing slot for PCI device %s", dev->name);
/* Xen's pciback.ko wants you to use remove_slot on the specific device */
if (!(path = virPCIDriverFile(driver, "remove_slot")))
reprobe:
if (!dev->reprobe) {
+ VIR_DEBUG("Reprobe skipped for PCI device %s", dev->name);
result = 0;
goto cleanup;
}
+ VIR_DEBUG("Reprobing for PCI device %s", dev->name);
+
/* Trigger a re-probe of the device is not in the stub's dynamic
* ID table. If the stub is available, but 'remove_id' isn't
* available, then re-probing would just cause the device to be