_VAPT_GET_WORKER="$__PKGLIBDIR/vapt-get-worker"
_VATTRIBUTE="$__SBINDIR/vattribute"
_VCONTEXT="$__SBINDIR/vcontext"
+_VDEVMAP="$__SBINDIR/vdevmap"
_VDLIMIT="$__SBINDIR/vdlimit"
_VDU="$__SBINDIR/vdu"
_VHASHIFY="$__PKGLIBDIR/vhashify"
done
}
+function loadDeviceMap
+{
+ local xid="$1"
+ local dir="$2"
+ local flags device target
+
+ test -d "$dir" || return 0
+
+ for i in "$dir"/*; do
+ test -d "$i" || continue
+
+ local -a vdevmap_opts=()
+ test -e "$i/create" && vdevmap_opts=( "${vdevmap_opts[@]}" --create )
+ test -e "$i/open" && vdevmap_opts=( "${vdevmap_opts[@]}" --open )
+ test -e "$i/remap" && vdevmap_opts=( "${vdevmap_opts[@]}" --remap )
+
+ getFileValue flags "$i/flags" || :
+ getFileValue device "$i/device" || :
+ getFileValue target "$i/target" || :
+ vdevmap_opts=( "${vdevmap_opts[@]}" ${flags:+--flags "$flags"} \
+ ${device:+--device "$device"} ${target:+--target "$target"} )
+
+ $_VDEVMAP --xid "$xid" "${vdevmap_opts[@]}" || return $?
+ done
+}
LOCKFILE=util-vserver
. "$_LIB_VSERVER_INIT_FUNCTIONS"
+. "$_LIB_FUNCTIONS"
+. "$__PKGLIBDIR/vserver.functions"
function set_helper()
set_helper
_endResult $?
local retval=$?
+ _beginResult $"Loading default device map"
+ loadDeviceMap 0 "$__CONFDIR/.defaults/apps/vdevmap"
+ _endResult $?
test "$retval" -ne 0 || touch "$lockfile"
return $retval
}
_beginResult $"Stopping all running guests"
$_START_VSERVERS -j 1 --all --stop
_endResult $?
- local retval=$?
_beginResult $"Killing all running contexts"
kill_contexts
_endResult $?
+ local retval=$?
$_RM -f "$lockfile"
+ return $retval
}
function restart()