Changeset 2460

Show
Ignore:
Timestamp:
01/18/07 17:35:03 (2 years ago)
Author:
dhozac
Message:

Add support for vdevmap in the configuration.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/scripts/util-vserver-vars.pathsubst

    r2458 r2460  
    7474_VATTRIBUTE="$__SBINDIR/vattribute" 
    7575_VCONTEXT="$__SBINDIR/vcontext" 
     76_VDEVMAP="$__SBINDIR/vdevmap" 
    7677_VDLIMIT="$__SBINDIR/vdlimit" 
    7778_VDU="$__SBINDIR/vdu" 
  • trunk/scripts/vserver.functions

    r2456 r2460  
    12271227} 
    12281228 
     1229function loadDeviceMap 
     1230{ 
     1231    local xid="$1" 
     1232    local dir="$2" 
     1233    local flags device target 
     1234 
     1235    test -d "$dir" || return 0 
     1236 
     1237    for i in "$dir"/*; do 
     1238        test -d "$i" || continue 
     1239 
     1240        local -a vdevmap_opts=() 
     1241        test -e "$i/create" && vdevmap_opts=( "${vdevmap_opts[@]}" --create ) 
     1242        test -e "$i/open"   && vdevmap_opts=( "${vdevmap_opts[@]}" --open ) 
     1243        test -e "$i/remap"  && vdevmap_opts=( "${vdevmap_opts[@]}" --remap ) 
     1244 
     1245        getFileValue flags "$i/flags" || : 
     1246        getFileValue device "$i/device" || : 
     1247        getFileValue target "$i/target" || : 
     1248        vdevmap_opts=(  "${vdevmap_opts[@]}" ${flags:+--flags "$flags"} \ 
     1249                        ${device:+--device "$device"} ${target:+--target "$target"} ) 
     1250 
     1251        $_VDEVMAP --xid "$xid" "${vdevmap_opts[@]}" || return $? 
     1252    done 
     1253} 
  • trunk/sysv/util-vserver

    r2445 r2460  
    1515LOCKFILE=util-vserver 
    1616. "$_LIB_VSERVER_INIT_FUNCTIONS" 
     17. "$_LIB_FUNCTIONS" 
     18. "$__PKGLIBDIR/vserver.functions" 
    1719 
    1820 
     
    5254    _endResult $? 
    5355    local retval=$? 
     56    _beginResult $"Loading default device map" 
     57    loadDeviceMap 0 "$__CONFDIR/.defaults/apps/vdevmap" 
     58    _endResult $? 
    5459    test "$retval" -ne 0 || touch "$lockfile" 
    5560    return $retval 
     
    6267    $_START_VSERVERS -j 1 --all --stop 
    6368    _endResult $? 
    64     local retval=$? 
    6569    _beginResult $"Killing all running contexts" 
    6670    kill_contexts 
    6771    _endResult $? 
     72    local retval=$? 
    6873    $_RM -f "$lockfile" 
     74    return $retval 
    6975} 
    7076