ia64/xen-unstable
changeset 7263:e9e10e783ccd
Merged.
author | emellor@ewan |
---|---|
date | Fri Oct 07 13:34:45 2005 +0100 (2005-10-07) |
parents | b5c5360a61d0 99532f6b2ae3 |
children | 409cea2432fc |
files |
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Fri Oct 07 13:34:10 2005 +0100 1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c Fri Oct 07 13:34:45 2005 +0100 1.3 @@ -67,12 +67,6 @@ void unbind_evtchn_from_irqhandler(unsig 1.4 evtchns[evtchn].handler = NULL; 1.5 } 1.6 1.7 -void unbind_evtchn_from_irq(unsigned int evtchn) 1.8 -{ 1.9 - printk("unbind_evtchn_from_irq called... FIXME??\n"); 1.10 - while(1); 1.11 -} 1.12 - 1.13 irqreturn_t evtchn_interrupt(int irq, void *dev_id, struct pt_regs *regs) 1.14 { 1.15 u32 l1, l2;
2.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Fri Oct 07 13:34:10 2005 +0100 2.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c Fri Oct 07 13:34:45 2005 +0100 2.3 @@ -296,7 +296,7 @@ void unbind_ipi_from_irq(int ipi) 2.4 } 2.5 EXPORT_SYMBOL(unbind_ipi_from_irq); 2.6 2.7 -int bind_evtchn_to_irq(unsigned int evtchn) 2.8 +static int bind_evtchn_to_irq(unsigned int evtchn) 2.9 { 2.10 int irq; 2.11 2.12 @@ -314,9 +314,8 @@ int bind_evtchn_to_irq(unsigned int evtc 2.13 2.14 return irq; 2.15 } 2.16 -EXPORT_SYMBOL(bind_evtchn_to_irq); 2.17 2.18 -void unbind_evtchn_from_irq(unsigned int irq) 2.19 +static void unbind_evtchn_from_irq(unsigned int irq) 2.20 { 2.21 evtchn_op_t op = { .cmd = EVTCHNOP_close }; 2.22 int evtchn = irq_to_evtchn[irq]; 2.23 @@ -333,7 +332,6 @@ void unbind_evtchn_from_irq(unsigned int 2.24 2.25 spin_unlock(&irq_mapping_update_lock); 2.26 } 2.27 -EXPORT_SYMBOL(unbind_evtchn_from_irq); 2.28 2.29 int bind_evtchn_to_irqhandler( 2.30 unsigned int evtchn, 2.31 @@ -347,8 +345,10 @@ int bind_evtchn_to_irqhandler( 2.32 2.33 irq = bind_evtchn_to_irq(evtchn); 2.34 retval = request_irq(irq, handler, irqflags, devname, dev_id); 2.35 - if (retval != 0) 2.36 + if (retval != 0) { 2.37 unbind_evtchn_from_irq(irq); 2.38 + return retval; 2.39 + } 2.40 2.41 return irq; 2.42 }
3.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c Fri Oct 07 13:34:10 2005 +0100 3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c Fri Oct 07 13:34:45 2005 +0100 3.3 @@ -74,6 +74,10 @@ int blkif_map(blkif_t *blkif, unsigned l 3.4 .u.bind_interdomain.remote_dom = blkif->domid, 3.5 .u.bind_interdomain.remote_port = evtchn }; 3.6 3.7 + /* Already connected through? */ 3.8 + if (blkif->irq) 3.9 + return 0; 3.10 + 3.11 if ( (blkif->blk_ring_area = alloc_vm_area(PAGE_SIZE)) == NULL ) 3.12 return -ENOMEM; 3.13 3.14 @@ -107,8 +111,12 @@ static void free_blkif(void *arg) 3.15 { 3.16 blkif_t *blkif = (blkif_t *)arg; 3.17 3.18 - if (blkif->irq) 3.19 - unbind_evtchn_from_irqhandler(blkif->irq, blkif); 3.20 + /* Already disconnected? */ 3.21 + if (!blkif->irq) 3.22 + return; 3.23 + 3.24 + unbind_evtchn_from_irqhandler(blkif->irq, blkif); 3.25 + blkif->irq = 0; 3.26 3.27 vbd_free(&blkif->vbd); 3.28
4.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c Fri Oct 07 13:34:10 2005 +0100 4.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c Fri Oct 07 13:34:45 2005 +0100 4.3 @@ -183,6 +183,10 @@ int netif_map(netif_t *netif, unsigned l 4.4 .u.bind_interdomain.remote_dom = netif->domid, 4.5 .u.bind_interdomain.remote_port = evtchn }; 4.6 4.7 + /* Already connected through? */ 4.8 + if (netif->irq) 4.9 + return 0; 4.10 + 4.11 netif->comms_area = alloc_vm_area(2*PAGE_SIZE); 4.12 if (netif->comms_area == NULL) 4.13 return -ENOMEM; 4.14 @@ -227,13 +231,12 @@ static void free_netif_callback(void *ar 4.15 { 4.16 netif_t *netif = (netif_t *)arg; 4.17 4.18 - /* 4.19 - * This can't be done in netif_disconnect() because at that point 4.20 - * there may be outstanding requests in the network stack whose 4.21 - * asynchronous responses must still be notified to the remote driver. 4.22 - */ 4.23 - if (netif->irq) 4.24 - unbind_evtchn_from_irqhandler(netif->irq, netif); 4.25 + /* Already disconnected? */ 4.26 + if (!netif->irq) 4.27 + return; 4.28 + 4.29 + unbind_evtchn_from_irqhandler(netif->irq, netif); 4.30 + netif->irq = 0; 4.31 4.32 unregister_netdev(netif->dev); 4.33
5.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Fri Oct 07 13:34:10 2005 +0100 5.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h Fri Oct 07 13:34:45 2005 +0100 5.3 @@ -52,14 +52,6 @@ extern int bind_ipi_to_irq(int ipi); 5.4 extern void unbind_ipi_from_irq(int ipi); 5.5 5.6 /* 5.7 - * Dynamically bind an event-channel port to Linux IRQ space. 5.8 - * BIND: Returns IRQ or error. 5.9 - * UNBIND: Takes IRQ to unbind from; automatically closes the event channel. 5.10 - */ 5.11 -extern int bind_evtchn_to_irq(unsigned int evtchn); 5.12 -extern void unbind_evtchn_from_irq(unsigned int irq); 5.13 - 5.14 -/* 5.15 * Dynamically bind an event-channel port to an IRQ-like callback handler. 5.16 * On some platforms this may not be implemented via the Linux IRQ subsystem. 5.17 * The IRQ argument passed to the callback handler is the same as returned
6.1 --- a/tools/examples/Makefile Fri Oct 07 13:34:10 2005 +0100 6.2 +++ b/tools/examples/Makefile Fri Oct 07 13:34:45 2005 +0100 6.3 @@ -22,8 +22,7 @@ XEN_SCRIPT_DIR = /etc/xen/scripts 6.4 XEN_SCRIPTS = network-bridge vif-bridge 6.5 XEN_SCRIPTS += network-route vif-route 6.6 XEN_SCRIPTS += network-nat vif-nat 6.7 -XEN_SCRIPTS += block-phy 6.8 -XEN_SCRIPTS += block-file 6.9 +XEN_SCRIPTS += block 6.10 XEN_SCRIPTS += block-enbd 6.11 6.12 XEN_HOTPLUG_DIR = /etc/hotplug
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/tools/examples/block Fri Oct 07 13:34:45 2005 +0100 7.3 @@ -0,0 +1,82 @@ 7.4 +#!/bin/sh 7.5 + 7.6 +set -e 7.7 + 7.8 +export PATH=/sbin:/bin:/usr/bin:/usr/sbin:$PATH 7.9 + 7.10 +expand_dev() { 7.11 + local dev 7.12 + case $1 in 7.13 + /*) 7.14 + dev=$1 7.15 + ;; 7.16 + *) 7.17 + dev=/dev/$1 7.18 + ;; 7.19 + esac 7.20 + echo -n $dev 7.21 +} 7.22 + 7.23 +write_dev() { 7.24 + local major 7.25 + local minor 7.26 + local pdev 7.27 + 7.28 + major=$(stat -L -c %t "$1") 7.29 + minor=$(stat -L -c %T "$1") 7.30 + pdev=$(printf "0x%02x%02x" 0x$major 0x$minor) 7.31 + xenstore-write "$XENBUS_PATH"/physical-device $pdev \ 7.32 + "$XENBUS_PATH"/node $1 7.33 +} 7.34 + 7.35 +t=$(xenstore-read "$XENBUS_PATH"/type) 7.36 + 7.37 +case $1 in 7.38 + bind) 7.39 + p=$(xenstore-read "$XENBUS_PATH"/params) 7.40 + case $t in 7.41 + phy) 7.42 + dev=$(expand_dev $p) 7.43 + write_dev "$dev" 7.44 + exit 0 7.45 + ;; 7.46 + 7.47 + file) 7.48 + for dev in /dev/loop* ; do 7.49 + echo "dev is $dev, p is $p" 7.50 + if losetup $dev $p; then 7.51 + write_dev "$dev" 7.52 + exit 0 7.53 + fi 7.54 + done 7.55 + exit 1 7.56 + ;; 7.57 + 7.58 + *) 7.59 + [ -x /etc/xen/scripts/block-"$t" ] && \ 7.60 + /etc/xen/scripts/block-"$t" bind $p 7.61 + ;; 7.62 + esac 7.63 + ;; 7.64 + 7.65 + unbind) 7.66 + node=$(xenstore-read "$XENBUS_PATH"/node) 7.67 + case $t in 7.68 + phy) 7.69 + exit 0 7.70 + ;; 7.71 + 7.72 + file) 7.73 + losetup -d $node 7.74 + exit 0 7.75 + ;; 7.76 + 7.77 + *) 7.78 + [ -x /etc/xen/scripts/block-"$t" ] && \ 7.79 + /etc/xen/scripts/block-"$t" unbind $node 7.80 + ;; 7.81 + 7.82 + esac 7.83 + ;; 7.84 + 7.85 +esac
8.1 --- a/tools/examples/block-file Fri Oct 07 13:34:10 2005 +0100 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,31 +0,0 @@ 8.4 -#!/bin/sh 8.5 - 8.6 -# Usage: block_loop [bind file|unbind node] 8.7 -# 8.8 -# The file argument to the bind command is the file we are to bind to a 8.9 -# loop device. 8.10 -# 8.11 -# The node argument to unbind is the name of the device node we are to 8.12 -# unbind. 8.13 - 8.14 -set -e 8.15 - 8.16 -case $1 in 8.17 - bind) 8.18 - for dev in /dev/loop*; do 8.19 - if losetup $dev $2; then 8.20 - major=$(stat -L -c %t "$dev") 8.21 - minor=$(stat -L -c %T "$dev") 8.22 - pdev=$(printf "0x%02x%02x" 0x$major 0x$minor) 8.23 - xenstore-write "$XENBUS_PATH"/physical-device $pdev \ 8.24 - "$XENBUS_PATH"/node $dev 8.25 - exit 0 8.26 - fi 8.27 - done 8.28 - exit 1 8.29 - ;; 8.30 - unbind) 8.31 - losetup -d $2 8.32 - exit 0 8.33 - ;; 8.34 -esac
9.1 --- a/tools/examples/block-phy Fri Oct 07 13:34:10 2005 +0100 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,30 +0,0 @@ 9.4 -#! /bin/sh 9.5 - 9.6 -set -e 9.7 - 9.8 -expand_dev() { 9.9 - local dev 9.10 - case $1 in 9.11 - /*) 9.12 - dev=$1 9.13 - ;; 9.14 - *) 9.15 - dev=/dev/$1 9.16 - ;; 9.17 - esac 9.18 - echo -n $dev 9.19 -} 9.20 - 9.21 -case $1 in 9.22 - bind) 9.23 - dev=$(expand_dev $2) 9.24 - major=$(stat -L -c %t "$dev") 9.25 - minor=$(stat -L -c %T "$dev") 9.26 - pdev=$(printf "0x%02x%02x" 0x$major 0x$minor) 9.27 - xenstore-write "$XENBUS_PATH"/physical-device $pdev \ 9.28 - "$XENBUS_PATH"/node $dev 9.29 - exit 0 9.30 - ;; 9.31 - unbind) 9.32 - ;; 9.33 -esac
10.1 --- a/tools/examples/vif-bridge Fri Oct 07 13:34:10 2005 +0100 10.2 +++ b/tools/examples/vif-bridge Fri Oct 07 13:34:45 2005 +0100 10.3 @@ -33,6 +33,7 @@ 10.4 10.5 # Exit if anything goes wrong 10.6 set -e 10.7 +export PATH=/sbin:/bin:/usr/bin:/usr/sbin:$PATH 10.8 10.9 echo "*vif-bridge $*" >&2 10.10
11.1 --- a/tools/examples/vif-nat Fri Oct 07 13:34:10 2005 +0100 11.2 +++ b/tools/examples/vif-nat Fri Oct 07 13:34:45 2005 +0100 11.3 @@ -22,7 +22,7 @@ 11.4 11.5 # Exit if anything goes wrong 11.6 set -e 11.7 - 11.8 +export PATH=/sbin:/bin:/usr/bin:/usr/sbin:$PATH 11.9 echo "*vif-nat $*" >&2 11.10 11.11 # Operation name.
12.1 --- a/tools/examples/vif-route Fri Oct 07 13:34:10 2005 +0100 12.2 +++ b/tools/examples/vif-route Fri Oct 07 13:34:45 2005 +0100 12.3 @@ -23,7 +23,7 @@ 12.4 12.5 # Exit if anything goes wrong 12.6 set -e 12.7 - 12.8 +export PATH=/sbin:/bin:/usr/bin:/usr/sbin:$PATH 12.9 echo "*vif-route $*" >&2 12.10 12.11 # Operation name.
13.1 --- a/tools/examples/xen-backend.agent Fri Oct 07 13:34:10 2005 +0100 13.2 +++ b/tools/examples/xen-backend.agent Fri Oct 07 13:34:45 2005 +0100 13.3 @@ -11,20 +11,14 @@ case "$ACTION" in 13.4 add) 13.5 case "$XENBUS_TYPE" in 13.6 vbd) 13.7 - t=$(xenstore-read "$XENBUS_PATH"/type) 13.8 - params=$(xenstore-read "$XENBUS_PATH"/params) 13.9 - [ -x /etc/xen/scripts/block-"$t" ] && \ 13.10 - /etc/xen/scripts/block-"$t" bind $params 13.11 + /etc/xen/scripts/block bind 13.12 ;; 13.13 esac 13.14 ;; 13.15 remove) 13.16 case "$XENBUS_TYPE" in 13.17 vbd) 13.18 - t=$(xenstore-read "$XENBUS_PATH"/type) 13.19 - node=$(xenstore-read "$XENBUS_PATH"/node) 13.20 - [ -x /etc/xen/scripts/block-"$t" ] && \ 13.21 - /etc/xen/scripts/block-"$t" unbind $node 13.22 + /etc/xen/scripts/block unbind 13.23 ;; 13.24 esac 13.25 # remove device backend store entries
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 14.2 +++ b/tools/examples/xen-backend.rules Fri Oct 07 13:34:45 2005 +0100 14.3 @@ -0,0 +1,4 @@ 14.4 +SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ACTION=="add", RUN+="/etc/xen/scripts/block bind" 14.5 +SUBSYSTEM=="xen-backend", KERNEL=="vbd*", ACTION=="remove", RUN+="/etc/xen/scripts/block unbind" 14.6 +SUBSYSTEM=="xen-backend", KERNEL=="vif*", ENV{PHYSDEVDRIVER}=="vif", ACTION=="online", RUN+="$env{script} up" 14.7 +SUBSYSTEM=="xen-backend", ACTION=="remove", RUN+="/usr/bin/xenstore-rm $env{XENBUS_PATH}"