# HG changeset patch # User kfraser@localhost.localdomain # Date 1154527641 -3600 # Node ID ab86a6f3b5ee3be0550194362f64c3aebfecefbf # Parent 08415dfc5918b43c79177237362237b2e3b6bca3 [PCI] Transparent virtualization for pcifront and pciback. Signed-off-by: Tristan Gingold diff -r 08415dfc5918 -r ab86a6f3b5ee linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c --- a/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c Wed Aug 02 15:06:29 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/pciback/xenbus.c Wed Aug 02 15:07:21 2006 +0100 @@ -445,6 +445,9 @@ static struct xenbus_driver xenbus_pciba int __init pciback_xenbus_register(void) { + if (!is_running_on_xen()) + return -ENODEV; + return xenbus_register_backend(&xenbus_pciback_driver); } diff -r 08415dfc5918 -r ab86a6f3b5ee linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c --- a/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c Wed Aug 02 15:06:29 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/pcifront/xenbus.c Wed Aug 02 15:07:21 2006 +0100 @@ -284,11 +284,10 @@ static struct xenbus_driver xenbus_pcifr static int __init pcifront_init(void) { - int err = 0; + if (!is_running_on_xen()) + return -ENODEV; - err = xenbus_register_frontend(&xenbus_pcifront_driver); - - return err; + return xenbus_register_frontend(&xenbus_pcifront_driver); } /* Initialize after the Xen PCI Frontend Stub is initialized */