diff options
author | Ian.Campbell@xensource.com <Ian.Campbell@xensource.com> | 2006-04-03 14:34:20 +0100 |
---|---|---|
committer | Ian.Campbell@xensource.com <Ian.Campbell@xensource.com> | 2006-04-03 14:34:20 +0100 |
commit | d3cf31ddb2d9be1098236472401185786c0f42e4 (patch) | |
tree | c35f3632a03630b24a1b8d4a1c3bee2c964e6d01 | |
parent | 0c48c2080d16c59c41ce24bc0ade4f03fbf200e0 (diff) | |
download | xen-d3cf31ddb2d9be1098236472401185786c0f42e4.tar.gz xen-d3cf31ddb2d9be1098236472401185786c0f42e4.tar.bz2 xen-d3cf31ddb2d9be1098236472401185786c0f42e4.zip |
Handle failure to register the xen store event channel instead of3.0.2-branched
just not initialising xenbus/store when the supervisor_mode_kernel
feature flag is enabled.
When initialising grant tables only -ENOSYS is a valid reason
to fail so BUG_ON anything else like we did prior to changeset
9498.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/core/gnttab.c | 6 | ||||
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c | 41 |
2 files changed, 26 insertions, 21 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c index fa12e701d4..71da6c4df9 100644 --- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c +++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c @@ -395,10 +395,10 @@ gnttab_resume(void) setup.frame_list = frames; rc = HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1); - if (rc < 0) - return rc; + if (rc == -ENOSYS) + return -ENOSYS; - BUG_ON(setup.status); + BUG_ON(rc || setup.status); #ifndef __ia64__ if (shared == NULL) { diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index db1492d050..e9c8315856 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -984,6 +984,7 @@ static int xsd_port_read(char *page, char **start, off_t off, static int __init xenbus_probe_init(void) { int err = 0, dom0; + unsigned long page = 0; DPRINTK(""); @@ -992,19 +993,9 @@ static int __init xenbus_probe_init(void) return -ENODEV; } - /* Register ourselves with the kernel bus & device subsystems */ + /* Register ourselves with the kernel bus subsystem */ bus_register(&xenbus_frontend.bus); bus_register(&xenbus_backend.bus); - device_register(&xenbus_frontend.dev); - device_register(&xenbus_backend.dev); - - /* - * The supervisor_mode_kernel feature only allows a single - * domain so there is no need to initialise event channels - * etc. - */ - if (xen_feature(XENFEAT_supervisor_mode_kernel)) - return -ENODEV; /* * Domain0 doesn't have a store_evtchn or store_mfn yet. @@ -1012,11 +1003,7 @@ static int __init xenbus_probe_init(void) dom0 = (xen_start_info->store_evtchn == 0); if (dom0) { - - unsigned long page; evtchn_op_t op = { 0 }; - int ret; - /* Allocate page. */ page = get_zeroed_page(GFP_KERNEL); @@ -1032,8 +1019,10 @@ static int __init xenbus_probe_init(void) op.u.alloc_unbound.dom = DOMID_SELF; op.u.alloc_unbound.remote_dom = 0; - ret = HYPERVISOR_event_channel_op(&op); - BUG_ON(ret); + err = HYPERVISOR_event_channel_op(&op); + if (err == -ENOSYS) + goto err; + BUG_ON(err); xen_start_info->store_evtchn = op.u.alloc_unbound.port; /* And finally publish the above info in /proc/xen */ @@ -1056,13 +1045,29 @@ static int __init xenbus_probe_init(void) if (err) { printk(KERN_WARNING "XENBUS: Error initializing xenstore comms: %i\n", err); - return err; + goto err; } + /* Register ourselves with the kernel device subsystem */ + device_register(&xenbus_frontend.dev); + device_register(&xenbus_backend.dev); + if (!dom0) xenbus_probe(NULL); return 0; + + err: + if (page) + free_page(page); + + /* + * Do not unregister the xenbus front/backend buses here. The + * buses must exist because front/backend drivers will use + * them when they are registered. + */ + + return err; } postcore_initcall(xenbus_probe_init); |