Jan Beulich
2012-Sep-25  08:54 UTC
[PATCH] linux-2.6.18/PCI: suppress bogus warning on old hypervisors
pci_bus_remove_wrapper() warned even for the -ENOSYS case. By detecting
the missing support early (in pci_bus_probe_wrapper()) we can avoid
this by removing the hooks altogether in this case.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/drivers/xen/core/pci.c
+++ b/drivers/xen/core/pci.c
@@ -45,8 +45,21 @@ static int pci_bus_probe_wrapper(struct 
 		r = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_add,
 					  &manage_pci);
 	}
-	if (r && r != -ENOSYS)
+
+	switch (r) {
+	case 0:
+		break;
+#if CONFIG_XEN_COMPAT < 0x030300
+	case -ENOSYS:
+		if (!manage_pci_ext.is_virtfn && !manage_pci_ext.is_extfn) {
+			pci_bus_type.probe = pci_bus_probe;
+			pci_bus_type.remove = pci_bus_remove;
+		}
+		break;
+#endif
+	default:
 		return r;
+	}
 
 	r = pci_bus_probe(dev);
 	return r;
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel