diff options
Diffstat (limited to 'net/9p/trans_xen.c')
-rw-r--r-- | net/9p/trans_xen.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c index 29420ebb8f07..3963eb11c3fb 100644 --- a/net/9p/trans_xen.c +++ b/net/9p/trans_xen.c @@ -530,13 +530,19 @@ static struct xenbus_driver xen_9pfs_front_driver = { static int p9_trans_xen_init(void) { + int rc; + if (!xen_domain()) return -ENODEV; pr_info("Initialising Xen transport for 9pfs\n"); v9fs_register_trans(&p9_xen_trans); - return xenbus_register_frontend(&xen_9pfs_front_driver); + rc = xenbus_register_frontend(&xen_9pfs_front_driver); + if (rc) + v9fs_unregister_trans(&p9_xen_trans); + + return rc; } module_init(p9_trans_xen_init); |