ia64/xen-unstable

view tools/examples/xen-backend.agent @ 6766:219d96d545fc

merge?
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 12 20:00:41 2005 +0000 (2005-09-12)
parents e9d01c5dc7b4 291e816acbf4
children 4d899a738d59 8ca0f98ba8e2
line source
1 #! /bin/sh
3 #ACTION=add
4 #DEVPATH=/devices/xen-backend/vif-1-0
5 #PHYSDEVDRIVER=vif
6 #XENBUS_TYPE=vif
8 PATH=/etc/xen/scripts:$PATH
10 case "$ACTION" in
11 add)
12 case "$XENBUS_TYPE" in
13 vbd)
14 t=$(xenstore-read "$XENBUS_PATH"/type)
15 params=$(xenstore-read "$XENBUS_PATH"/params)
16 [ -x /etc/xen/scripts/block-"$t" ] && \
17 /etc/xen/scripts/block-"$t" bind $params
18 ;;
19 esac
20 ;;
21 remove)
22 case "$XENBUS_TYPE" in
23 vbd)
24 t=$(xenstore-read "$XENBUS_PATH"/type)
25 node=$(xenstore-read "$XENBUS_PATH"/node)
26 [ -x /etc/xen/scripts/block-"$t" ] && \
27 /etc/xen/scripts/block-"$t" unbind $node
28 ;;
29 esac
30 # remove device backend store entries
31 xenstore-rm "$XENBUS_PATH"
32 ;;
33 online)
34 case "$PHYSDEVDRIVER" in
35 vif)
36 [ -n "$script" ] && $script up
37 ;;
38 esac
39 ;;
40 offline)
41 ;;
42 esac