SHA256
1
0
forked from pool/xen
OBS User unknown
2007-02-11 10:48:10 +00:00
committed by Git OBS Bridge
parent 241ee9df04
commit d7002a96b9
166 changed files with 35454 additions and 7164 deletions

View File

@@ -105,10 +105,19 @@ running_auto_names()
parseln()
{
name=`echo "$1" | cut -c0-49`
name=${1:0:$((${#1}-36))}
name=${name%% *}
rest=`echo "$1" | cut -c40- `
read id mem vcpu state tm < <(echo "$rest")
rest="${1: -36}"
id=${rest:0:4}
id=`echo $id`
mem=${rest:4:6}
mem=`echo $mem`
vcpu=${rest:10:6}
vcpu=`echo $vcpu`
state=${rest:16:11}
state=`echo $state`
tm=${rest:27}
tm=`echo $tm`
}
is_cfg_running()
@@ -116,9 +125,12 @@ is_cfg_running()
get_name_from_cfg "$1"
while read LN; do
parseln "$LN"
[ $id = 0 ] && continue
[ "$name" = "$NM" ] && return 0
done < <(xm list | grep -v '^Name')
[ "$id" = 0 ] && continue
if [ "$name" = "$NM" ]; then
[ -z "$state" ] && return 1
return 0
fi
done < <(xm list | grep -v '^Name *ID')
return 1
}
@@ -189,9 +201,10 @@ any_non_zombies()
{
while read LN; do
parseln "$LN"
[ $id = 0 ] && continue
[ "$id" = 0 ] && continue
[ -z "$state" ] && continue
is_zombie_state "$state" || return 0
done < <(xm list | grep -v '^Name')
done < <(xm list | grep -v '^Name *ID')
return 1
}
@@ -261,7 +274,8 @@ stop()
local printed=0
while read LN; do
parseln "$LN"
[ $id = 0 ] && continue
[ "$id" = 0 ] && continue
[ -z "$state" ] && continue
printed=1
if [ "$XENDOMAINS_AUTO_ONLY" = "true" ]; then
is_auto_domain=0
@@ -354,7 +368,7 @@ stop()
fi
rc_status -v
fi
done < <(xm list | grep -v '^Name')
done < <(xm list | grep -v '^Name *ID')
if [ -n "$XENDOMAINS_SHUTDOWN_ALL" ] && any_non_zombies ; then
echo -n " others: shutting down... "
@@ -379,9 +393,12 @@ check_domain_up()
{
while read LN; do
parseln "$LN"
[ $id = 0 ] && continue
[ "$name" = "$1" ] && return 0
done < <(xm list | grep -v "^Name")
[ "$id" = 0 ] && continue
if [ "$name" = "$1" ]; then
[ -z "$state" ] && return 1
return 0
fi
done < <(xm list | grep -v '^Name *ID')
return 1
}