direct-io.hg

changeset 6419:6ac24e39c9a4

Add hotplug script to run vif-bridge up script when a backend vif starts up.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 17:27:31 2005 +0000 (2005-08-25)
parents 0610add7c3fe
children b4b3f6be5226
files tools/examples/Makefile tools/examples/backend.hotplug
line diff
     1.1 --- a/tools/examples/Makefile	Thu Aug 25 16:27:04 2005 +0000
     1.2 +++ b/tools/examples/Makefile	Thu Aug 25 17:27:31 2005 +0000
     1.3 @@ -24,10 +24,14 @@ XEN_SCRIPTS += block-enbd
     1.4  XEN_BOOT_DIR = /usr/lib/xen/boot
     1.5  XEN_BOOT = mem-map.sxp
     1.6  
     1.7 +XEN_HOTPLUG_DIR = /etc/hotplug.d/xen-backend
     1.8 +XEN_HOTPLUG_SCRIPTS = backend.hotplug
     1.9 +
    1.10  all: 
    1.11  build:
    1.12  
    1.13 -install: all install-initd install-configs install-scripts install-boot
    1.14 +install: all install-initd install-configs install-scripts install-boot \
    1.15 +	 install-hotplug
    1.16  
    1.17  install-initd:
    1.18  	[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
    1.19 @@ -60,4 +64,12 @@ install-boot:
    1.20  	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_BOOT_DIR); \
    1.21  	done
    1.22  
    1.23 +install-hotplug:
    1.24 +	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
    1.25 +		$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
    1.26 +	for i in $(XEN_HOTPLUG_SCRIPTS); \
    1.27 +	    do [ -a $(DESTDIR)$(XEN_HOTPLUG_DIR)/$$i ] || \
    1.28 +	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
    1.29 +	done
    1.30 +
    1.31  clean:
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/examples/backend.hotplug	Thu Aug 25 17:27:31 2005 +0000
     2.3 @@ -0,0 +1,21 @@
     2.4 +#! /bin/sh
     2.5 +
     2.6 +#DEVPATH=/devices/xen-backend/vif-1-0
     2.7 +#ACTION=add
     2.8 +
     2.9 +PATH=/etc/xen/scripts:$PATH
    2.10 +
    2.11 +DEV=$(basename "$DEVPATH")
    2.12 +case "$ACTION" in
    2.13 +  add)
    2.14 +    case "$DEV" in
    2.15 +      vif-*)
    2.16 +        vif=$(echo "$DEV" | sed 's/-\([0-9]*\)-\([0-9]*\)/\1.\2/')
    2.17 +        vif-bridge up domain=unknown vif="$vif" mac=fe:ff:ff:ff:ff:ff bridge=xen-br0 >/dev/null 2>&1
    2.18 +        ;;
    2.19 +    esac
    2.20 +    ;;
    2.21 +  remove)
    2.22 +    ;;
    2.23 +esac
    2.24 +