ia64/xen-unstable
changeset 8356:d48b19263e46
merge?
author | chris@ubuntu.eng.hq.xensource.com |
---|---|
date | Tue Dec 13 19:05:57 2005 -0700 (2005-12-13) |
parents | 99a1f5dc75a9 3c88c4d68fc1 |
children | 6691252943d1 |
files | .hgignore Config.mk buildconfigs/mk.linux-2.6-xen |
line diff
1.1 --- a/.hgignore Tue Dec 13 19:04:14 2005 -0700 1.2 +++ b/.hgignore Tue Dec 13 19:05:57 2005 -0700 1.3 @@ -10,6 +10,7 @@ 1.4 .*\.tar\.bz2$ 1.5 .*\.tar\.gz$ 1.6 .*~$ 1.7 +^build.*$ 1.8 ^dist/.*$ 1.9 ^docs/.*\.aux$ 1.10 ^docs/.*\.dvi$
2.1 --- a/Config.mk Tue Dec 13 19:04:14 2005 -0700 2.2 +++ b/Config.mk Tue Dec 13 19:05:57 2005 -0700 2.3 @@ -3,7 +3,7 @@ 2.4 # Currently supported architectures: x86_32, x86_64 2.5 XEN_COMPILE_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/) 2.6 XEN_TARGET_ARCH ?= $(XEN_COMPILE_ARCH) 2.7 -XEN_TARGET_X86_PAE ?= n 2.8 +XEN_TARGET_X86_PAE ?= y 2.9 2.10 # Tools to run on system hosting the build 2.11 HOSTCC = gcc
3.1 --- a/buildconfigs/mk.linux-2.6-xen Tue Dec 13 19:04:14 2005 -0700 3.2 +++ b/buildconfigs/mk.linux-2.6-xen Tue Dec 13 19:05:57 2005 -0700 3.3 @@ -6,7 +6,8 @@ LINUX_VER = 2.6.12 3.4 3.5 EXTRAVERSION ?= xen 3.6 3.7 -LINUX_DIR = $(OS)-$(LINUX_VER)-$(EXTRAVERSION) 3.8 +LINUX_SRCDIR = $(OS)-$(LINUX_VER)-xen 3.9 +LINUX_DIR = build-$(OS)-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH) 3.10 3.11 include buildconfigs/Rules.mk 3.12 3.13 @@ -20,25 +21,32 @@ build: $(LINUX_DIR)/include/linux/autoco 3.14 fi 3.15 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) install 3.16 3.17 -$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref 3.18 - rm -rf $(LINUX_DIR) 3.19 - cp -al $(<D) $(LINUX_DIR) 3.20 +$(LINUX_SRCDIR)/.valid-src: ref-$(OS)-$(LINUX_VER)/.valid-ref 3.21 + rm -rf $(LINUX_SRCDIR) 3.22 + cp -al $(<D) $(LINUX_SRCDIR) 3.23 # Apply arch-xen patches 3.24 ( cd linux-$(LINUX_SERIES)-xen-sparse ; \ 3.25 - LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_DIR) ) 3.26 + LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_SRCDIR) ) 3.27 + # Patch kernel Makefile to set EXTRAVERSION 3.28 + ( cd $(LINUX_SRCDIR) ; \ 3.29 + sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)/' \ 3.30 + -e 's,^KERNELRELEASE=,XENGUEST := $$(shell [ -r $$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; \ 3.31 + rm -f Makefile ; mv Mk.tmp Makefile ) 3.32 + touch $@ 3.33 + 3.34 +$(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src 3.35 + rm -rf $(LINUX_DIR) 3.36 + mkdir -p $(LINUX_DIR) 3.37 # Re-use config from install dir if one exits else use default config 3.38 - CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \ 3.39 + CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \ 3.40 [ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \ 3.41 cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \ 3.42 - || cp $(LINUX_DIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(XEN_TARGET_ARCH) \ 3.43 + || cp $(LINUX_SRCDIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(XEN_TARGET_ARCH) \ 3.44 $(LINUX_DIR)/.config 3.45 # See if we need to munge config to enable PAE 3.46 $(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk config-update-pae 3.47 - # Patch kernel Makefile to set EXTRAVERSION 3.48 - ( cd $(LINUX_DIR) ; \ 3.49 - sed -e 's/^EXTRAVERSION.*/&$$(XENGUEST)\nXENGUEST = -$(EXTRAVERSION)/' Makefile >Mk.tmp ; \ 3.50 - rm -f Makefile ; mv Mk.tmp Makefile ) 3.51 - $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) oldconfig 3.52 + echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest 3.53 + $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR) 3.54 3.55 prep: $(LINUX_DIR)/include/linux/autoconf.h 3.56
4.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Tue Dec 13 19:04:14 2005 -0700 4.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Tue Dec 13 19:05:57 2005 -0700 4.3 @@ -639,6 +639,44 @@ void notify_remote_via_irq(int irq) 4.4 } 4.5 EXPORT_SYMBOL(notify_remote_via_irq); 4.6 4.7 +void mask_evtchn(int port) 4.8 +{ 4.9 + shared_info_t *s = HYPERVISOR_shared_info; 4.10 + synch_set_bit(port, &s->evtchn_mask[0]); 4.11 +} 4.12 +EXPORT_SYMBOL(mask_evtchn); 4.13 + 4.14 +void unmask_evtchn(int port) 4.15 +{ 4.16 + shared_info_t *s = HYPERVISOR_shared_info; 4.17 + unsigned int cpu = smp_processor_id(); 4.18 + vcpu_info_t *vcpu_info = &s->vcpu_info[cpu]; 4.19 + 4.20 + /* Slow path (hypercall) if this is a non-local port. */ 4.21 + if (unlikely(cpu != cpu_from_evtchn(port))) { 4.22 + evtchn_op_t op = { .cmd = EVTCHNOP_unmask, 4.23 + .u.unmask.port = port }; 4.24 + (void)HYPERVISOR_event_channel_op(&op); 4.25 + return; 4.26 + } 4.27 + 4.28 + synch_clear_bit(port, &s->evtchn_mask[0]); 4.29 + 4.30 + /* 4.31 + * The following is basically the equivalent of 'hw_resend_irq'. Just 4.32 + * like a real IO-APIC we 'lose the interrupt edge' if the channel is 4.33 + * masked. 4.34 + */ 4.35 + if (synch_test_bit(port, &s->evtchn_pending[0]) && 4.36 + !synch_test_and_set_bit(port / BITS_PER_LONG, 4.37 + &vcpu_info->evtchn_pending_sel)) { 4.38 + vcpu_info->evtchn_upcall_pending = 1; 4.39 + if (!vcpu_info->evtchn_upcall_mask) 4.40 + force_evtchn_callback(); 4.41 + } 4.42 +} 4.43 +EXPORT_SYMBOL(unmask_evtchn); 4.44 + 4.45 void irq_resume(void) 4.46 { 4.47 evtchn_op_t op;
5.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Tue Dec 13 19:04:14 2005 -0700 5.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Tue Dec 13 19:05:57 2005 -0700 5.3 @@ -10,8 +10,11 @@ 5.4 * Copyright (c) 2005, Christopher Clark 5.5 * Copyright (c) 2005, XenSource Ltd 5.6 * 5.7 - * This file may be distributed separately from the Linux kernel, or 5.8 - * incorporated into other software packages, subject to the following license: 5.9 + * This program is free software; you can redistribute it and/or 5.10 + * modify it under the terms of the GNU General Public License version 2 5.11 + * as published by the Free Software Foundation; or, when distributed 5.12 + * separately from the Linux kernel or incorporated into other 5.13 + * software packages, subject to the following license: 5.14 * 5.15 * Permission is hereby granted, free of charge, to any person obtaining a copy 5.16 * of this source file (the "Software"), to deal in the Software without 5.17 @@ -820,7 +823,7 @@ static void xlblk_exit(void) 5.18 } 5.19 module_exit(xlblk_exit); 5.20 5.21 -MODULE_LICENSE("BSD"); 5.22 +MODULE_LICENSE("Dual BSD/GPL"); 5.23 5.24 5.25 /*
6.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c Tue Dec 13 19:04:14 2005 -0700 6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c Tue Dec 13 19:05:57 2005 -0700 6.3 @@ -168,7 +168,7 @@ static void kcons_write_dom0( 6.4 6.5 static struct tty_driver *kcons_device(struct console *c, int *index) 6.6 { 6.7 - *index = c->index; 6.8 + *index = 0; 6.9 return xencons_driver; 6.10 } 6.11
7.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 13 19:04:14 2005 -0700 7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 13 19:05:57 2005 -0700 7.3 @@ -4,8 +4,11 @@ 7.4 * Copyright (c) 2002-2005, K A Fraser 7.5 * Copyright (c) 2005, XenSource Ltd 7.6 * 7.7 - * This file may be distributed separately from the Linux kernel, or 7.8 - * incorporated into other software packages, subject to the following license: 7.9 + * This program is free software; you can redistribute it and/or 7.10 + * modify it under the terms of the GNU General Public License version 2 7.11 + * as published by the Free Software Foundation; or, when distributed 7.12 + * separately from the Linux kernel or incorporated into other 7.13 + * software packages, subject to the following license: 7.14 * 7.15 * Permission is hereby granted, free of charge, to any person obtaining a copy 7.16 * of this source file (the "Software"), to deal in the Software without 7.17 @@ -1294,7 +1297,7 @@ static void netif_exit(void) 7.18 } 7.19 module_exit(netif_exit); 7.20 7.21 -MODULE_LICENSE("BSD"); 7.22 +MODULE_LICENSE("Dual BSD/GPL"); 7.23 7.24 7.25 /* ** /proc **/
8.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Tue Dec 13 19:04:14 2005 -0700 8.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Tue Dec 13 19:05:57 2005 -0700 8.3 @@ -79,46 +79,16 @@ extern int bind_ipi_to_irqhandler( 8.4 */ 8.5 extern void unbind_from_irqhandler(unsigned int irq, void *dev_id); 8.6 8.7 -/* 8.8 - * Unlike notify_remote_via_evtchn(), this is safe to use across 8.9 - * save/restore. Notifications on a broken connection are silently dropped. 8.10 - */ 8.11 -void notify_remote_via_irq(int irq); 8.12 - 8.13 extern void irq_resume(void); 8.14 8.15 /* Entry point for notifications into Linux subsystems. */ 8.16 asmlinkage void evtchn_do_upcall(struct pt_regs *regs); 8.17 8.18 /* Entry point for notifications into the userland character device. */ 8.19 -void evtchn_device_upcall(int port); 8.20 - 8.21 -static inline void mask_evtchn(int port) 8.22 -{ 8.23 - shared_info_t *s = HYPERVISOR_shared_info; 8.24 - synch_set_bit(port, &s->evtchn_mask[0]); 8.25 -} 8.26 - 8.27 -static inline void unmask_evtchn(int port) 8.28 -{ 8.29 - shared_info_t *s = HYPERVISOR_shared_info; 8.30 - vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()]; 8.31 +extern void evtchn_device_upcall(int port); 8.32 8.33 - synch_clear_bit(port, &s->evtchn_mask[0]); 8.34 - 8.35 - /* 8.36 - * The following is basically the equivalent of 'hw_resend_irq'. Just 8.37 - * like a real IO-APIC we 'lose the interrupt edge' if the channel is 8.38 - * masked. 8.39 - */ 8.40 - if (synch_test_bit(port, &s->evtchn_pending[0]) && 8.41 - !synch_test_and_set_bit(port / BITS_PER_LONG, 8.42 - &vcpu_info->evtchn_pending_sel)) { 8.43 - vcpu_info->evtchn_upcall_pending = 1; 8.44 - if (!vcpu_info->evtchn_upcall_mask) 8.45 - force_evtchn_callback(); 8.46 - } 8.47 -} 8.48 +extern void mask_evtchn(int port); 8.49 +extern void unmask_evtchn(int port); 8.50 8.51 static inline void clear_evtchn(int port) 8.52 { 8.53 @@ -134,6 +104,12 @@ static inline void notify_remote_via_evt 8.54 (void)HYPERVISOR_event_channel_op(&op); 8.55 } 8.56 8.57 +/* 8.58 + * Unlike notify_remote_via_evtchn(), this is safe to use across 8.59 + * save/restore. Notifications on a broken connection are silently dropped. 8.60 + */ 8.61 +extern void notify_remote_via_irq(int irq); 8.62 + 8.63 #endif /* __ASM_EVTCHN_H__ */ 8.64 8.65 /*
9.1 --- a/tools/examples/vif-common.sh Tue Dec 13 19:04:14 2005 -0700 9.2 +++ b/tools/examples/vif-common.sh Tue Dec 13 19:05:57 2005 -0700 9.3 @@ -53,6 +53,17 @@ XENBUS_PATH="${XENBUS_PATH:?}" 9.4 vif="${vif:?}" 9.5 9.6 9.7 +vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "") 9.8 +if [ "$vifname" ] 9.9 +then 9.10 + if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null 9.11 + then 9.12 + do_or_die ip link set "$vif" name "$vifname" 9.13 + fi 9.14 + vif="$vifname" 9.15 +fi 9.16 + 9.17 + 9.18 function frob_iptable() 9.19 { 9.20 if [ "$command" == "online" ]
10.1 --- a/tools/python/xen/xend/XendClient.py Tue Dec 13 19:04:14 2005 -0700 10.2 +++ b/tools/python/xen/xend/XendClient.py Tue Dec 13 19:05:57 2005 -0700 10.3 @@ -354,7 +354,7 @@ class Xend: 10.4 def getHttpServer(srv=None): 10.5 """Create and return a xend client. 10.6 """ 10.7 - return Xend(srv=srv, client=XendClientProtocol()) 10.8 + return Xend(srv=srv, client=HttpXendClientProtocol()) 10.9 10.10 def getUnixServer(srv=None): 10.11 """Create and return a unix-domain xend client.
11.1 --- a/tools/python/xen/xend/XendProtocol.py Tue Dec 13 19:04:14 2005 -0700 11.2 +++ b/tools/python/xen/xend/XendProtocol.py Tue Dec 13 19:05:57 2005 -0700 11.3 @@ -13,10 +13,12 @@ 11.4 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 11.5 #============================================================================ 11.6 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com> 11.7 +# Copyright (C) 2005 XenSource Ltd. 11.8 #============================================================================ 11.9 11.10 import socket 11.11 import httplib 11.12 +import time 11.13 import types 11.14 11.15 from encode import * 11.16 @@ -165,24 +167,38 @@ class HttpXendClientProtocol(XendClientP 11.17 @param method: http method: POST or GET 11.18 @param args: request arguments (dict) 11.19 """ 11.20 - self.request = self.makeRequest(url, method, args) 11.21 - conn = self.makeConnection(url) 11.22 - if DEBUG: conn.set_debuglevel(1) 11.23 - conn.request(method, url.fullpath(), self.request.data, self.request.headers) 11.24 - resp = conn.getresponse() 11.25 - self.resp = resp 11.26 - val = self.handleStatus(resp.version, resp.status, resp.reason) 11.27 - if val is None: 11.28 - data = None 11.29 - else: 11.30 - data = resp.read() 11.31 - conn.close() 11.32 - val = self.handleResponse(data) 11.33 - return val 11.34 + retries = 0 11.35 + while retries < 2: 11.36 + self.request = self.makeRequest(url, method, args) 11.37 + conn = self.makeConnection(url) 11.38 + try: 11.39 + if DEBUG: conn.set_debuglevel(1) 11.40 + conn.request(method, url.fullpath(), self.request.data, 11.41 + self.request.headers) 11.42 + try: 11.43 + resp = conn.getresponse() 11.44 + self.resp = resp 11.45 + val = self.handleStatus(resp.version, resp.status, 11.46 + resp.reason) 11.47 + if val is None: 11.48 + data = None 11.49 + else: 11.50 + data = resp.read() 11.51 + val = self.handleResponse(data) 11.52 + return val 11.53 + except httplib.BadStatusLine: 11.54 + retries += 1 11.55 + time.sleep(5) 11.56 + finally: 11.57 + conn.close() 11.58 + 11.59 + raise XendError("Received invalid response from Xend, twice.") 11.60 + 11.61 11.62 def getHeader(self, key): 11.63 return self.resp.getheader(key) 11.64 11.65 + 11.66 class UnixConnection(httplib.HTTPConnection): 11.67 """Subclass of Python library HTTPConnection that uses a unix-domain socket. 11.68 """
12.1 --- a/tools/python/xen/xend/server/netif.py Tue Dec 13 19:04:14 2005 -0700 12.2 +++ b/tools/python/xen/xend/server/netif.py Tue Dec 13 19:05:57 2005 -0700 12.3 @@ -74,9 +74,10 @@ class NetifController(DevController): 12.4 typ = sxp.child_value(config, 'type') 12.5 if typ == 'ioemu': 12.6 return (None,{},{}) 12.7 - bridge = sxp.child_value(config, 'bridge') 12.8 - mac = sxp.child_value(config, 'mac') 12.9 - ipaddr = _get_config_ipaddr(config) 12.10 + bridge = sxp.child_value(config, 'bridge') 12.11 + mac = sxp.child_value(config, 'mac') 12.12 + vifname = sxp.child_value(config, 'vifname') 12.13 + ipaddr = _get_config_ipaddr(config) 12.14 12.15 devid = self.allocateDeviceID() 12.16 12.17 @@ -90,6 +91,8 @@ class NetifController(DevController): 12.18 back['ip'] = ' '.join(ipaddr) 12.19 if bridge: 12.20 back['bridge'] = bridge 12.21 + if vifname: 12.22 + back['vifname'] = vifname 12.23 12.24 front = { 'handle' : "%i" % devid, 12.25 'mac' : mac } 12.26 @@ -102,9 +105,8 @@ class NetifController(DevController): 12.27 12.28 result = DevController.configuration(self, devid) 12.29 12.30 - (script, ip, bridge, mac) = self.readBackend(devid, 12.31 - 'script', 'ip', 'bridge', 12.32 - 'mac') 12.33 + (script, ip, bridge, mac, typ, vifname) = self.readBackend( 12.34 + devid, 'script', 'ip', 'bridge', 'mac', 'type', 'vifname') 12.35 12.36 if script: 12.37 result.append(['script', 12.38 @@ -116,5 +118,9 @@ class NetifController(DevController): 12.39 result.append(['bridge', bridge]) 12.40 if mac: 12.41 result.append(['mac', mac]) 12.42 + if typ: 12.43 + result.append(['type', typ]) 12.44 + if vifname: 12.45 + result.append(['vifname', vifname]) 12.46 12.47 return result
13.1 --- a/tools/python/xen/xm/tests/test_create.py Tue Dec 13 19:04:14 2005 -0700 13.2 +++ b/tools/python/xen/xm/tests/test_create.py Tue Dec 13 19:05:57 2005 -0700 13.3 @@ -141,5 +141,55 @@ cpu_weight = 0.75 13.4 }) 13.5 13.6 13.7 + def testVMXConfigFile(self): 13.8 + (fd, fname) = tempfile.mkstemp() 13.9 + try: 13.10 + os.write(fd, 13.11 + ''' 13.12 +kernel = "/usr/lib/xen/boot/vmxloader" 13.13 +builder='vmx' 13.14 +memory = 128 13.15 +name = "ExampleVMXDomain" 13.16 +vcpus=1 13.17 +vif = [ 'type=ioemu, bridge=xenbr0' ] 13.18 +disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ] 13.19 +device_model = '/usr/lib/xen/bin/qemu-dm' 13.20 +sdl=0 13.21 +vnc=1 13.22 +vncviewer=1 13.23 +ne2000=0 13.24 + ''') 13.25 + finally: 13.26 + os.close(fd) 13.27 + 13.28 + self.t('-f %s display=fakedisplay' % fname, 13.29 + { 'kernel' : '/usr/lib/xen/boot/vmxloader', 13.30 + 'builder' : 'vmx', 13.31 + 'memory' : 128, 13.32 + 'name' : 'ExampleVMXDomain', 13.33 + 'vcpus' : 1, 13.34 + 'nics' : -1, 13.35 + 'vif' : ['type=ioemu, bridge=xenbr0'], 13.36 + 'disk' : [['file:/var/images/min-el3-i386.img', 13.37 + 'ioemu:hda', 'w', None]], 13.38 + 'device_model': '/usr/lib/xen/bin/qemu-dm', 13.39 + 13.40 + 'extra' : ('VNC_VIEWER=%s:%d ' % 13.41 + (xen.xm.create.get_host_addr(), 13.42 + xen.xm.create.VNC_BASE_PORT + 1)), 13.43 + 'vnc' : 1, 13.44 + 'vncviewer' : 1, 13.45 + 13.46 + 'xm_file' : fname, 13.47 + 'defconfig' : fname, 13.48 + 'display' : 'fakedisplay', 13.49 + 13.50 + 'boot' : 'c', 13.51 + 'dhcp' : 'off', 13.52 + 'interface' : 'eth0', 13.53 + 'path' : '.:/etc/xen', 13.54 + }) 13.55 + 13.56 + 13.57 def test_suite(): 13.58 return unittest.makeSuite(test_create)
14.1 --- a/tools/xm-test/lib/XmTestReport/Report.py Tue Dec 13 19:04:14 2005 -0700 14.2 +++ b/tools/xm-test/lib/XmTestReport/Report.py Tue Dec 13 19:05:57 2005 -0700 14.3 @@ -31,10 +31,12 @@ import os 14.4 import xml.dom.minidom 14.5 import httplib 14.6 import urllib 14.7 +import re 14.8 14.9 #REPORT_HOST = "xmtest-dev.dague.org" 14.10 REPORT_HOST = "xmtest.dague.org" 14.11 REPORT_URL = "/cgi-bin/report-results"; 14.12 +VIEW_URL = "cgi-bin/display?view=single&testid=" 14.13 14.14 class XmTestReport: 14.15 14.16 @@ -101,16 +103,21 @@ def postResults(results): 14.17 conn.request("POST", REPORT_URL, body, headers) 14.18 14.19 resp = conn.getresponse() 14.20 + data = resp.read() 14.21 + 14.22 if resp.status == 200: 14.23 print >>sys.stderr, "Your results have been submitted successfully!" 14.24 + match = re.match("^id=([0-9]+)$", data.split("\n")[1]) 14.25 + if match: 14.26 + id = match.group(1) 14.27 + print >>sys.stderr, "See your report at:" 14.28 + print >>sys.stderr, "http://%s/%s%s" % (REPORT_HOST, VIEW_URL, id) 14.29 else: 14.30 print >>sys.stderr, "Unable to submit results:" 14.31 print >>sys.stderr, "[http://%s%s] said %i: %s" % (REPORT_HOST, 14.32 REPORT_URL, 14.33 resp.status, 14.34 resp.reason) 14.35 - 14.36 - data = resp.read() 14.37 print >>sys.stderr, data 14.38 14.39 if __name__ == "__main__":
15.1 --- a/xen/common/event_channel.c Tue Dec 13 19:04:14 2005 -0700 15.2 +++ b/xen/common/event_channel.c Tue Dec 13 19:05:57 2005 -0700 15.3 @@ -3,7 +3,7 @@ 15.4 * 15.5 * Event notifications from VIRQs, PIRQs, and other domains. 15.6 * 15.7 - * Copyright (c) 2003-2004, K A Fraser. 15.8 + * Copyright (c) 2003-2005, K A Fraser. 15.9 * 15.10 * This program is distributed in the hope that it will be useful, 15.11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15.12 @@ -541,6 +541,41 @@ static long evtchn_bind_vcpu(evtchn_bind 15.13 return rc; 15.14 } 15.15 15.16 +static long evtchn_unmask(evtchn_unmask_t *unmask) 15.17 +{ 15.18 + struct domain *d = current->domain; 15.19 + shared_info_t *s = d->shared_info; 15.20 + int port = unmask->port; 15.21 + struct vcpu *v; 15.22 + 15.23 + spin_lock(&d->evtchn_lock); 15.24 + 15.25 + if ( unlikely(!port_is_valid(d, port)) ) 15.26 + { 15.27 + spin_unlock(&d->evtchn_lock); 15.28 + return -EINVAL; 15.29 + } 15.30 + 15.31 + v = d->vcpu[evtchn_from_port(d, port)->notify_vcpu_id]; 15.32 + 15.33 + /* 15.34 + * These operations must happen in strict order. Based on 15.35 + * include/xen/event.h:evtchn_set_pending(). 15.36 + */ 15.37 + if ( test_and_clear_bit(port, &s->evtchn_mask[0]) && 15.38 + test_bit (port, &s->evtchn_pending[0]) && 15.39 + !test_and_set_bit (port / BITS_PER_LONG, 15.40 + &v->vcpu_info->evtchn_pending_sel) && 15.41 + !test_and_set_bit (0, &v->vcpu_info->evtchn_upcall_pending) ) 15.42 + { 15.43 + evtchn_notify(v); 15.44 + } 15.45 + 15.46 + spin_unlock(&d->evtchn_lock); 15.47 + 15.48 + return 0; 15.49 +} 15.50 + 15.51 long do_event_channel_op(evtchn_op_t *uop) 15.52 { 15.53 long rc; 15.54 @@ -602,6 +637,10 @@ long do_event_channel_op(evtchn_op_t *uo 15.55 rc = evtchn_bind_vcpu(&op.u.bind_vcpu); 15.56 break; 15.57 15.58 + case EVTCHNOP_unmask: 15.59 + rc = evtchn_unmask(&op.u.unmask); 15.60 + break; 15.61 + 15.62 default: 15.63 rc = -ENOSYS; 15.64 break;
16.1 --- a/xen/include/public/event_channel.h Tue Dec 13 19:04:14 2005 -0700 16.2 +++ b/xen/include/public/event_channel.h Tue Dec 13 19:05:57 2005 -0700 16.3 @@ -164,6 +164,16 @@ typedef struct evtchn_bind_vcpu { 16.4 uint32_t vcpu; 16.5 } evtchn_bind_vcpu_t; 16.6 16.7 +/* 16.8 + * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver 16.9 + * a notification to the appropriate VCPU if an event is pending. 16.10 + */ 16.11 +#define EVTCHNOP_unmask 9 16.12 +typedef struct evtchn_unmask { 16.13 + /* IN parameters. */ 16.14 + evtchn_port_t port; 16.15 +} evtchn_unmask_t; 16.16 + 16.17 typedef struct evtchn_op { 16.18 uint32_t cmd; /* EVTCHNOP_* */ 16.19 union { 16.20 @@ -176,6 +186,7 @@ typedef struct evtchn_op { 16.21 evtchn_send_t send; 16.22 evtchn_status_t status; 16.23 evtchn_bind_vcpu_t bind_vcpu; 16.24 + evtchn_unmask_t unmask; 16.25 } u; 16.26 } evtchn_op_t; 16.27
17.1 --- a/xen/include/xen/event.h Tue Dec 13 19:04:14 2005 -0700 17.2 +++ b/xen/include/xen/event.h Tue Dec 13 19:05:57 2005 -0700 17.3 @@ -3,7 +3,7 @@ 17.4 * 17.5 * A nice interface for passing asynchronous events to guest OSes. 17.6 * 17.7 - * Copyright (c) 2002, K A Fraser 17.8 + * Copyright (c) 2002-2005, K A Fraser 17.9 */ 17.10 17.11 #ifndef __XEN_EVENT_H__