On 04/06/2011 01:13 AM, Wen Congyang wrote:
We should bind pci device to original driver when pciBindDeviceToStub() failed.
If the pci device is not bound to any driver before calling pciBindDeviceToStub(),
we should only unbind it from pci-stub. If it is bound to pci-stub, we should not
unbid it from pci-stub.
s/unbid/unbind/
+remove_id:
/* If 'remove_id' exists, remove the device id from pci-stub's dynamic
* ID table so that 'drivers_probe' works below.
*/
if (pciDriverFile(&path, driver, "remove_id") < 0) {
+ /* We do not remove PCI ID from pci-stub, and we can not reprobe it */
+ if (dev->reprobe) {
+ VIR_WARN("Not remove PCI ID '%s' from %s, and the device
can"
+ "not be reprobed again.", dev->id, driver);
s/Not remove/Could not remove/
s/can not/cannot/
s/reprobed again/probed again/
@@ -1018,6 +1086,13 @@ pciBindDeviceToStub(pciDevice *dev, const char
*driver)
virReportSystemError(errno,
_("Failed to remove PCI ID '%s' from
%s"),
dev->id, driver);
+
+ /* remove PCI ID from pci-stub failed, and we can not reprobe it */
+ if (dev->reprobe) {
+ VIR_WARN("Faile to remove PCI ID '%s' from %s, and the device
can"
+ "not be reprobed again.", dev->id, driver);
s/Faile /Failed /
s/reprobed again/probed again/
ACK with those warning message grammar cleanups.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org