diff options
author | Alex Zeffertt <alex.zeffertt@eu.citrix.com> | 2009-01-07 21:07:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 11:30:59 -0500 |
commit | 1107ba885e46964316c083d441d5dd185b6c9e49 (patch) | |
tree | 98cc3f81ad7ff554e10fc263abfb7727a438cc5a /drivers/xen/xenbus | |
parent | d8220347da2a0639f5e1919a5af08f49cb37c24f (diff) |
xen: add xenfs to allow usermode <-> Xen interaction
The xenfs filesystem exports various interfaces to usermode. Initially
this exports a file to allow usermode to interact with xenbus/xenstore.
Traditionally this appeared in /proc/xen. Rather than extending procfs,
this patch adds a backward-compat mountpoint on /proc/xen, and provides
a xenfs filesystem which can be mounted there.
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 28 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 1 |
2 files changed, 23 insertions, 6 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index b2a03184a246..773d1cf23283 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/ctype.h> | 40 | #include <linux/ctype.h> |
41 | #include <linux/fcntl.h> | 41 | #include <linux/fcntl.h> |
42 | #include <linux/mm.h> | 42 | #include <linux/mm.h> |
43 | #include <linux/proc_fs.h> | ||
43 | #include <linux/notifier.h> | 44 | #include <linux/notifier.h> |
44 | #include <linux/kthread.h> | 45 | #include <linux/kthread.h> |
45 | #include <linux/mutex.h> | 46 | #include <linux/mutex.h> |
@@ -55,7 +56,10 @@ | |||
55 | #include "xenbus_comms.h" | 56 | #include "xenbus_comms.h" |
56 | #include "xenbus_probe.h" | 57 | #include "xenbus_probe.h" |
57 | 58 | ||
59 | |||
58 | int xen_store_evtchn; | 60 | int xen_store_evtchn; |
61 | EXPORT_SYMBOL(xen_store_evtchn); | ||
62 | |||
59 | struct xenstore_domain_interface *xen_store_interface; | 63 | struct xenstore_domain_interface *xen_store_interface; |
60 | static unsigned long xen_store_mfn; | 64 | static unsigned long xen_store_mfn; |
61 | 65 | ||
@@ -166,6 +170,9 @@ static int read_backend_details(struct xenbus_device *xendev) | |||
166 | return read_otherend_details(xendev, "backend-id", "backend"); | 170 | return read_otherend_details(xendev, "backend-id", "backend"); |
167 | } | 171 | } |
168 | 172 | ||
173 | static struct device_attribute xenbus_dev_attrs[] = { | ||
174 | __ATTR_NULL | ||
175 | }; | ||
169 | 176 | ||
170 | /* Bus type for frontend drivers. */ | 177 | /* Bus type for frontend drivers. */ |
171 | static struct xen_bus_type xenbus_frontend = { | 178 | static struct xen_bus_type xenbus_frontend = { |
@@ -174,12 +181,13 @@ static struct xen_bus_type xenbus_frontend = { | |||
174 | .get_bus_id = frontend_bus_id, | 181 | .get_bus_id = frontend_bus_id, |
175 | .probe = xenbus_probe_frontend, | 182 | .probe = xenbus_probe_frontend, |
176 | .bus = { | 183 | .bus = { |
177 | .name = "xen", | 184 | .name = "xen", |
178 | .match = xenbus_match, | 185 | .match = xenbus_match, |
179 | .uevent = xenbus_uevent, | 186 | .uevent = xenbus_uevent, |
180 | .probe = xenbus_dev_probe, | 187 | .probe = xenbus_dev_probe, |
181 | .remove = xenbus_dev_remove, | 188 | .remove = xenbus_dev_remove, |
182 | .shutdown = xenbus_dev_shutdown, | 189 | .shutdown = xenbus_dev_shutdown, |
190 | .dev_attrs = xenbus_dev_attrs, | ||
183 | }, | 191 | }, |
184 | }; | 192 | }; |
185 | 193 | ||
@@ -852,6 +860,14 @@ static int __init xenbus_probe_init(void) | |||
852 | if (!xen_initial_domain()) | 860 | if (!xen_initial_domain()) |
853 | xenbus_probe(NULL); | 861 | xenbus_probe(NULL); |
854 | 862 | ||
863 | #ifdef CONFIG_XEN_COMPAT_XENFS | ||
864 | /* | ||
865 | * Create xenfs mountpoint in /proc for compatibility with | ||
866 | * utilities that expect to find "xenbus" under "/proc/xen". | ||
867 | */ | ||
868 | proc_mkdir("xen", NULL); | ||
869 | #endif | ||
870 | |||
855 | return 0; | 871 | return 0; |
856 | 872 | ||
857 | out_unreg_back: | 873 | out_unreg_back: |
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 7f2f91c0e11d..e325eab4724d 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -184,6 +184,7 @@ void *xenbus_dev_request_and_reply(struct xsd_sockmsg *msg) | |||
184 | 184 | ||
185 | return ret; | 185 | return ret; |
186 | } | 186 | } |
187 | EXPORT_SYMBOL(xenbus_dev_request_and_reply); | ||
187 | 188 | ||
188 | /* Send message to xs, get kmalloc'ed reply. ERR_PTR() on error. */ | 189 | /* Send message to xs, get kmalloc'ed reply. ERR_PTR() on error. */ |
189 | static void *xs_talkv(struct xenbus_transaction t, | 190 | static void *xs_talkv(struct xenbus_transaction t, |