mirror of https://gitee.com/openkylin/libvirt.git
pci: Add debug messages when unbinding from stub driver
Unbinding a PCI device from the stub driver can require several steps, and it can be useful for debugging to be able to trace which of these steps are performed and which are skipped for each device.
This commit is contained in:
parent
771eaeb2b3
commit
171607296d
|
@ -1106,26 +1106,37 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
|
|||
|
||||
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")))
|
||||
|
@ -1141,10 +1152,13 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue