Files
xen/tools/examples/block-enbd
T
emellor@leeni.uk.xensource.com 892f3730ae Match rename of parameters to match the corresponding hotplug events. This
took place some time ago, so presumably not many people are using this scripts!

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 17:07:19 +00:00

28 lines
496 B
Bash
Executable File

#!/bin/sh
# Usage: block-enbd [bind server ctl_port |unbind node]
#
# The node argument to unbind is the name of the device node we are to
# unbind.
#
# This assumes you're running a correctly configured server at the other end!
dir=$(dirname "$0")
. "$dir/block-common.sh"
case "$command" in
add)
for dev in /dev/nd*; do
if nbd-client $2:$3 $dev; then
write_dev $dev
exit 0
fi
done
exit 1
;;
remove)
nbd-client -d $2
exit 0
;;
esac