xen-vtx-unstable

view tools/examples/block-phy @ 6742:e9d01c5dc7b4

Move block device bind/unbind into hotplug scripts.
Fixes file: devices since unbind now runs after the backend driver
closes the loopback device.
Also moves name -> node translation into the backend domain.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 12 19:49:03 2005 +0000 (2005-09-12)
parents
children
line source
1 #! /bin/sh
3 set -e
5 expand_dev() {
6 local dev
7 case $1 in
8 /*)
9 dev=$1
10 ;;
11 *)
12 dev=/dev/$1
13 ;;
14 esac
15 echo -n $dev
16 }
18 case $1 in
19 bind)
20 dev=$(expand_dev $2)
21 major=$(stat -L -c %t "$dev")
22 minor=$(stat -L -c %T "$dev")
23 pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
24 xenstore-write "$XENBUS_PATH"/physical-device $pdev \
25 "$XENBUS_PATH"/node $dev
26 exit 0
27 ;;
28 unbind)
29 ;;
30 esac