[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
ChangeSet 1.1306, 2005/04/15 23:32:57+01:00, iap10@xxxxxxxxxxxxxxxxxxxxx Merge freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk into freefall.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h | 11 +--- tools/misc/xend | 58 +++++++++++++++++++++++ tools/xentrace/Makefile | 1 xen/Makefile | 8 +-- 4 files changed, 67 insertions(+), 11 deletions(-) diff -Nru a/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h --- a/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h 2005-04-15 19:03:54 -04:00 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/evtchn.h 2005-04-15 19:03:54 -04:00 @@ -36,14 +36,12 @@ #include <asm/ptrace.h> #include <asm/synch_bitops.h> #include <asm-xen/xen-public/event_channel.h> +#include <linux/smp.h> /* * LOW-LEVEL DEFINITIONS */ -/* Force a proper event-channel callback from Xen. */ -void force_evtchn_callback(void); - /* Entry point for notifications into Linux subsystems. */ asmlinkage void evtchn_do_upcall(struct pt_regs *regs); @@ -59,6 +57,7 @@ static inline void unmask_evtchn(int port) { shared_info_t *s = HYPERVISOR_shared_info; + vcpu_info_t *vcpu_info = &s->vcpu_data[smp_processor_id()]; synch_clear_bit(port, &s->evtchn_mask[0]); @@ -67,10 +66,10 @@ * a real IO-APIC we 'lose the interrupt edge' if the channel is masked. */ if ( synch_test_bit (port, &s->evtchn_pending[0]) && - !synch_test_and_set_bit(port>>5, &s->evtchn_pending_sel) ) + !synch_test_and_set_bit(port>>5, &vcpu_info->evtchn_pending_sel) ) { - s->vcpu_data[0].evtchn_upcall_pending = 1; - if ( !s->vcpu_data[0].evtchn_upcall_mask ) + vcpu_info->evtchn_upcall_pending = 1; + if ( !vcpu_info->evtchn_upcall_mask ) force_evtchn_callback(); } } diff -Nru a/tools/misc/xend b/tools/misc/xend --- a/tools/misc/xend 2005-04-15 19:03:54 -04:00 +++ b/tools/misc/xend 2005-04-15 19:03:54 -04:00 @@ -21,6 +21,14 @@ """ import os import sys +import socket +import signal +import time + +XCS_PATH = "/var/lib/xen/xcs_socket" +XCS_EXEC = "/usr/sbin/xcs" +XCS_PIDFILE = "/var/run/xcs.pid" +XCS_ARGS = (XCS_EXEC, "-p", XCS_PIDFILE) # add fallback path for non-native python path installs if needed sys.path.append('/usr/lib/python') @@ -89,7 +97,51 @@ msg("Xend must be run as root.") hline() raise CheckError("invalid user") + +def xcs_running(): + """ See if the control switch is running. + """ + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + try: + s.connect( (XCS_PATH) ) + s.close() + except: + try: + os.remove(XCS_PIDFILE) + except: + pass + return 0 + return 1 +def start_xcs(): + if (not xcs_running()): + if os.fork(): + time.sleep(0.1) # let xcs start + else: + if not os.path.isdir(os.path.dirname(XCS_PATH)): + os.makedirs(os.path.dirname(XCS_PATH)) + try: + os.execvp(XCS_EXEC, XCS_ARGS) + except: + hline() + msg("Tried to start xcs, but failed. Is it installed?") + hline() + raise CheckError("couldn't start xcs") + if (not xcs_running()): + hline() + msg("Failed to start the control interface switch.") + hline() + raise CheckError("xcs not running") + +def stop_xcs(): + try: + xcs_pidfile = open(XCS_PIDFILE) + xcs_pid = int(xcs_pidfile.read().strip()) + os.kill(xcs_pid, signal.SIGTERM) + xcs_pidfile.close() + except: + return + def main(): try: check_logging() @@ -97,6 +149,7 @@ check_user() except CheckError: sys.exit(1) + daemon = SrvDaemon.instance() if not sys.argv[1:]: print 'usage: %s {start|stop|restart}' % sys.argv[0] @@ -104,12 +157,17 @@ pid, status = os.wait() return status >> 8 elif sys.argv[1] == 'start': + start_xcs() return daemon.start() elif sys.argv[1] == 'trace_start': + start_xcs() return daemon.start(trace=1) elif sys.argv[1] == 'stop': + stop_xcs() return daemon.stop() elif sys.argv[1] == 'restart': + stop_xcs() + start_xcs() return daemon.stop() or daemon.start() elif sys.argv[1] == 'status': return daemon.status() diff -Nru a/tools/xentrace/Makefile b/tools/xentrace/Makefile --- a/tools/xentrace/Makefile 2005-04-15 19:03:54 -04:00 +++ b/tools/xentrace/Makefile 2005-04-15 19:03:54 -04:00 @@ -6,7 +6,6 @@ XEN_ROOT=../.. include $(XEN_ROOT)/tools/Rules.mk -CC = gcc CFLAGS += -Wall -Werror -O3 CFLAGS += -I $(XEN_XC) diff -Nru a/xen/Makefile b/xen/Makefile --- a/xen/Makefile 2005-04-15 19:03:54 -04:00 +++ b/xen/Makefile 2005-04-15 19:03:54 -04:00 @@ -8,9 +8,9 @@ # This is the correct place to edit the build version. # All other places this is stored (eg. compile.h) should be autogenerated. -export XEN_VERSION = 2 +export XEN_VERSION = 3 export XEN_SUBVERSION = 0 -export XEN_EXTRAVERSION = "" +export XEN_EXTRAVERSION = "-devel" export BASEDIR := $(CURDIR) @@ -79,9 +79,9 @@ @mv -f $@.new $@ tools/figlet/figlet: tools/figlet/figlet.o - $(CC) -o $@ $< + $(HOSTCC) -o $@ $< tools/figlet/figlet.o: tools/figlet/figlet.c - $(CC) -o $@ -c $< + $(HOSTCC) -o $@ -c $< include/xen/banner.h: tools/figlet/figlet tools/figlet/xen.flf tools/figlet/figlet -d tools/figlet Xen $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) > $@.new _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |