forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Jeremy Fitzhardinge <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
Showing
10 changed files
with
716 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
obj-y += grant-table.o features.o events.o manage.o | ||
obj-y += xenbus/ | ||
|
||
obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o | ||
obj-$(CONFIG_XEN_XENCOMM) += xencomm.o | ||
obj-$(CONFIG_XEN_BALLOON) += balloon.o | ||
obj-$(CONFIG_XENFS) += xenfs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
obj-$(CONFIG_XENFS) += xenfs.o | ||
|
||
xenfs-objs = super.o xenbus.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* xenfs.c - a filesystem for passing info between the a domain and | ||
* the hypervisor. | ||
* | ||
* 2008-10-07 Alex Zeffertt Replaced /proc/xen/xenbus with xenfs filesystem | ||
* and /proc/xen compatibility mount point. | ||
* Turned xenfs into a loadable module. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/errno.h> | ||
#include <linux/module.h> | ||
#include <linux/fs.h> | ||
#include <linux/magic.h> | ||
|
||
#include "xenfs.h" | ||
|
||
#include <asm/xen/hypervisor.h> | ||
|
||
MODULE_DESCRIPTION("Xen filesystem"); | ||
MODULE_LICENSE("GPL"); | ||
|
||
static int xenfs_fill_super(struct super_block *sb, void *data, int silent) | ||
{ | ||
static struct tree_descr xenfs_files[] = { | ||
[2] = {"xenbus", &xenbus_file_ops, S_IRUSR|S_IWUSR}, | ||
{""}, | ||
}; | ||
|
||
return simple_fill_super(sb, XENFS_SUPER_MAGIC, xenfs_files); | ||
} | ||
|
||
static int xenfs_get_sb(struct file_system_type *fs_type, | ||
int flags, const char *dev_name, | ||
void *data, struct vfsmount *mnt) | ||
{ | ||
return get_sb_single(fs_type, flags, data, xenfs_fill_super, mnt); | ||
} | ||
|
||
static struct file_system_type xenfs_type = { | ||
.owner = THIS_MODULE, | ||
.name = "xenfs", | ||
.get_sb = xenfs_get_sb, | ||
.kill_sb = kill_litter_super, | ||
}; | ||
|
||
static int __init xenfs_init(void) | ||
{ | ||
if (xen_pv_domain()) | ||
return register_filesystem(&xenfs_type); | ||
|
||
printk(KERN_INFO "XENFS: not registering filesystem on non-xen platform\n"); | ||
return 0; | ||
} | ||
|
||
static void __exit xenfs_exit(void) | ||
{ | ||
if (xen_pv_domain()) | ||
unregister_filesystem(&xenfs_type); | ||
} | ||
|
||
module_init(xenfs_init); | ||
module_exit(xenfs_exit); | ||
|
Oops, something went wrong.