diff options
author | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-03-01 11:13:22 +0000 |
---|---|---|
committer | kaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk> | 2004-03-01 11:13:22 +0000 |
commit | 7b4d7f59643abd011dabaae680ea08619cdb350b (patch) | |
tree | 63c1b35b44d9e53932b7dc8503dbb11a5c97876e | |
parent | be342af92bb5a82f38149cf0f93d5b787e133fa6 (diff) | |
download | xen-7b4d7f59643abd011dabaae680ea08619cdb350b.tar.gz xen-7b4d7f59643abd011dabaae680ea08619cdb350b.tar.bz2 xen-7b4d7f59643abd011dabaae680ea08619cdb350b.zip |
bitkeeper revision 1.759 (40431ad2YWsArtM623Q4wpLgPvrt5A)
xend.c, Makefile:
new file
Many files:
Rename /proc/xeno and /dev/xeno to /proc/xen and /dev/xen. Created a skeleton xend.
-rw-r--r-- | .rootkeys | 2 | ||||
-rw-r--r-- | tools/Makefile | 4 | ||||
-rw-r--r-- | tools/balloon/balloon.c | 4 | ||||
-rw-r--r-- | tools/misc/xen_cpuperf.c | 7 | ||||
-rw-r--r-- | tools/misc/xen_log.c | 4 | ||||
-rw-r--r-- | tools/xc/lib/xc_misc.c | 2 | ||||
-rw-r--r-- | tools/xc/py/XenoUtil.py | 2 | ||||
-rw-r--r-- | tools/xend/Makefile | 30 | ||||
-rw-r--r-- | tools/xend/xend.c | 12 | ||||
-rw-r--r-- | xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c | 40 | ||||
-rw-r--r-- | xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c | 4 |
11 files changed, 82 insertions, 29 deletions
@@ -88,6 +88,8 @@ 3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/xc/py/Xc.c 3fbd4bd6GtGwZGxYUJPOheYIR7bPaA tools/xc/py/XenoUtil.py 3fbd0a40yT6G3M9hMpaz5xTUdl0E4g tools/xc/py/setup.py +40431ac64Hj4ixUnKmlugZKhXPFE_Q tools/xend/Makefile +40431ac8wrUEj-XM7B8smFtx_HA7lQ tools/xend/xend.c 403a3edbrr8RE34gkbR40zep98SXbg tools/xentrace/Makefile 403a3edbVpV2E_wq1zeEkJ_n4Uu2eg tools/xentrace/xentrace.c 403a3edb0lzD0Fojc-NYNoXr3SYrnA tools/xentrace/xentrace_cpusplit.py diff --git a/tools/Makefile b/tools/Makefile index 4717987d6c..17d7c74ca8 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,6 +23,7 @@ all: $(MAKE) -C misc $(MAKE) -C examples $(MAKE) -C xentrace + $(MAKE) -C xend install: all $(MAKE) -C balloon install @@ -30,6 +31,7 @@ install: all $(MAKE) -C misc install $(MAKE) -C examples install $(MAKE) -C xentrace install + $(MAKE) -C xend install dist: all $(MAKE) -C balloon dist @@ -37,6 +39,7 @@ dist: all $(MAKE) -C misc dist $(MAKE) -C examples dist $(MAKE) -C xentrace dist + $(MAKE) -C xend dist clean: $(MAKE) -C balloon clean @@ -45,4 +48,5 @@ clean: $(MAKE) -C examples clean $(MAKE) -C nsplitd clean $(MAKE) -C xentrace clean + $(MAKE) -C xend clean diff --git a/tools/balloon/balloon.c b/tools/balloon/balloon.c index 9c90a7ab62..a8b6c406df 100644 --- a/tools/balloon/balloon.c +++ b/tools/balloon/balloon.c @@ -1,7 +1,7 @@ /****************************************************************************** * balloon.c * - * Xeno balloon driver userspace control tool. Used to shrink/grow domain's + * Xen balloon driver userspace control tool. Used to shrink/grow domain's * memory. * * Copyright (c) 2003, B Dragovic @@ -31,7 +31,7 @@ typedef struct user_balloon_op { static int open_balloon_proc() { - return open("/proc/xeno/balloon", O_RDWR); + return open("/proc/xen/balloon", O_RDWR); } /* inflate balloon function signals to kernel it should relinquish memory */ diff --git a/tools/misc/xen_cpuperf.c b/tools/misc/xen_cpuperf.c index 8b67f27c85..235ca58a39 100644 --- a/tools/misc/xen_cpuperf.c +++ b/tools/misc/xen_cpuperf.c @@ -1,10 +1,5 @@ /* * User mode program to prod MSR values through /proc/perfcntr - * - * - * $Id$ - * - * $Log$ */ #include <sys/types.h> @@ -217,7 +212,7 @@ int main(int argc, char **argv) } } - if ( (privfd = open("/proc/xeno/privcmd", O_RDWR)) == -1 ) + if ( (privfd = open("/proc/xen/privcmd", O_RDWR)) == -1 ) { fprintf(stderr, "Could not open privileged Xen control interface.\n"); exit(1); diff --git a/tools/misc/xen_log.c b/tools/misc/xen_log.c index 63bb5afa43..29f7d4c050 100644 --- a/tools/misc/xen_log.c +++ b/tools/misc/xen_log.c @@ -155,11 +155,11 @@ int main(int argc, char **argv) errno = 2; errexit("daemon"); } else { - openlog("xenolog", LOG_PID, SYSLOGTO); + openlog("xen_log", LOG_PID, SYSLOGTO); } break; case 'h': - printf("Usage: xenolog [options]\n"); + printf("Usage: xen_log [options]\n"); printf("Capture and display output of xen domains.\n\n"); printf(" -d Daemonize and send output to syslog.\n"); exit(0); diff --git a/tools/xc/lib/xc_misc.c b/tools/xc/lib/xc_misc.c index 63c53146b7..15fcead97c 100644 --- a/tools/xc/lib/xc_misc.c +++ b/tools/xc/lib/xc_misc.c @@ -8,7 +8,7 @@ int xc_interface_open(void) { - int fd = open("/proc/xeno/privcmd", O_RDWR); + int fd = open("/proc/xen/privcmd", O_RDWR); if ( fd == -1 ) PERROR("Could not obtain handle on privileged command interface"); return fd; diff --git a/tools/xc/py/XenoUtil.py b/tools/xc/py/XenoUtil.py index 06a623e9bb..27b6fbb390 100644 --- a/tools/xc/py/XenoUtil.py +++ b/tools/xc/py/XenoUtil.py @@ -72,7 +72,7 @@ def setup_vfr_rules_for_vif(dom,vif,addr): is expressed as a textual dotted quad, and set up appropriate routing rules in Xen. No return value. """ - fd = os.open( '/proc/xeno/vfr', os.O_WRONLY ) + fd = os.open( '/proc/xen/vfr', os.O_WRONLY ) if ( re.search( '169\.254', addr) ): os.write( fd, 'ADD ACCEPT srcaddr=' + addr + ' srcaddrmask=255.255.255.255' + diff --git a/tools/xend/Makefile b/tools/xend/Makefile new file mode 100644 index 0000000000..1fb84e0aaf --- /dev/null +++ b/tools/xend/Makefile @@ -0,0 +1,30 @@ + +CC = gcc +CFLAGS = -Wall -O3 +CFLAGS += -I../../xen/include -I../../xenolinux-sparse/include + +HDRS = $(wildcard *.h) +OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) + +BIN = xend + +all: $(BIN) + +install: all + mkdir -p /usr/sbin + cp $(BIN) /usr/sbin + chmod 755 /usr/sbin/$(BIN) + +dist: all + mkdir -p ../../../install/sbin + cp $(BIN) ../../../install/sbin + chmod 755 ../../../install/sbin/$(BIN) + +clean: + $(RM) *.a *.so *.o *.rpm $(BIN) + +$(BIN): $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ -L../xc/lib -lxc + +%.o: %.c $(HDRS) Makefile + $(CC) $(CFLAGS) -c -o $@ $< diff --git a/tools/xend/xend.c b/tools/xend/xend.c new file mode 100644 index 0000000000..9da656e0a1 --- /dev/null +++ b/tools/xend/xend.c @@ -0,0 +1,12 @@ +/****************************************************************************** + * xend.c + * + * The grand Xen daemon. For now it's just a console concentrator. + * + * Copyright (c) 2004, K A Fraser + */ + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c b/xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c index 1bfd377f9a..cac0201558 100644 --- a/xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c +++ b/xenolinux-2.4.25-sparse/arch/xeno/drivers/evtchn/xl_evtchn.c @@ -27,26 +27,26 @@ typedef void (*evtchn_receiver_t)(unsigned int); #define PORT_DISCONNECT 0x8000 #define PORTIDX_MASK 0x7fff -/* /dev/xeno/evtchn resides at device number major=10, minor=200 */ +/* /dev/xen/evtchn resides at device number major=10, minor=200 */ #define EVTCHN_MINOR 200 -/* /dev/xeno/evtchn ioctls: */ +/* /dev/xen/evtchn ioctls: */ /* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */ #define EVTCHN_RESET _IO('E', 1) -/* NB. This must be shared amongst drivers if more things go in /dev/xeno */ -static devfs_handle_t xeno_dev_dir; +/* NB. This must be shared amongst drivers if more things go in /dev/xen */ +static devfs_handle_t xen_dev_dir; -/* Only one process may open /dev/xeno/evtchn at any time. */ +/* Only one process may open /dev/xen/evtchn at any time. */ static unsigned long evtchn_dev_inuse; -/* Notification ring, accessed via /dev/xeno/evtchn. */ +/* Notification ring, accessed via /dev/xen/evtchn. */ #define RING_SIZE 2048 /* 2048 16-bit entries */ #define RING_MASK(_i) ((_i)&(RING_SIZE-1)) static u16 *ring; static unsigned int ring_cons, ring_prod, ring_overflow; -/* Processes wait on this queue via /dev/xeno/evtchn when ring is empty. */ +/* Processes wait on this queue via /dev/xen/evtchn when ring is empty. */ static DECLARE_WAIT_QUEUE_HEAD(evtchn_wait); static struct fasync_struct *evtchn_async_queue; @@ -228,12 +228,17 @@ static ssize_t evtchn_read(struct file *file, char *buf, add_wait_queue(&evtchn_wait, &wait); - if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) ) + count &= ~1; /* even number of bytes */ + + if ( count == 0 ) { - rc = -EINVAL; + rc = 0; goto out; } + if ( count > PAGE_SIZE ) + count = PAGE_SIZE; + for ( ; ; ) { set_current_state(TASK_INTERRUPTIBLE); @@ -307,12 +312,17 @@ static ssize_t evtchn_write(struct file *file, const char *buf, if ( kbuf == NULL ) return -ENOMEM; - if ( (count <= 0) || (count > PAGE_SIZE) || ((count&1) != 0) ) + count &= ~1; /* even number of bytes */ + + if ( count == 0 ) { - rc = -EINVAL; + rc = 0; goto out; } + if ( count > PAGE_SIZE ) + count = PAGE_SIZE; + if ( copy_from_user(kbuf, buf, count) != 0 ) { rc = -EFAULT; @@ -427,8 +437,8 @@ static int __init init_module(void) return err; } - /* (DEVFS) create directory '/dev/xeno'. */ - xeno_dev_dir = devfs_mk_dir(NULL, "xeno", NULL); + /* (DEVFS) create directory '/dev/xen'. */ + xen_dev_dir = devfs_mk_dir(NULL, "xen", NULL); /* (DEVFS) &link_dest[pos] == '../misc/evtchn'. */ pos = devfs_generate_path(evtchn_miscdev.devfs_handle, @@ -437,8 +447,8 @@ static int __init init_module(void) if ( pos >= 0 ) strncpy(&link_dest[pos], "../", 3); - /* (DEVFS) symlink '/dev/xeno/evtchn' -> '../misc/evtchn'. */ - (void)devfs_mk_symlink(xeno_dev_dir, + /* (DEVFS) symlink '/dev/xen/evtchn' -> '../misc/evtchn'. */ + (void)devfs_mk_symlink(xen_dev_dir, "evtchn", DEVFS_FL_DEFAULT, &link_dest[pos], diff --git a/xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c b/xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c index 40b0d6086f..2eca39d6aa 100644 --- a/xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c +++ b/xenolinux-2.4.25-sparse/arch/xeno/lib/xeno_proc.c @@ -7,8 +7,8 @@ static struct proc_dir_entry *xeno_base; struct proc_dir_entry *create_xeno_proc_entry(const char *name, mode_t mode) { if ( xeno_base == NULL ) - if ( (xeno_base = proc_mkdir("xeno", &proc_root)) == NULL ) - panic("Couldn't create /proc/xeno"); + if ( (xeno_base = proc_mkdir("xen", &proc_root)) == NULL ) + panic("Couldn't create /proc/xen"); return create_proc_entry(name, mode, xeno_base); } |