[Pkg-xen-changes] r992 - trunk/xen/debian
Bastian Blank
waldi at alioth.debian.org
Sun Apr 22 21:07:53 UTC 2012
Author: waldi
Date: Sun Apr 22 21:07:53 2012
New Revision: 992
Log:
debian/xen-utils-common.xendomains.init: Cleanup name detection.
Modified:
trunk/xen/debian/xen-utils-common.xendomains.init
Modified: trunk/xen/debian/xen-utils-common.xendomains.init
==============================================================================
--- trunk/xen/debian/xen-utils-common.xendomains.init Sun Apr 22 21:04:45 2012 (r991)
+++ trunk/xen/debian/xen-utils-common.xendomains.init Sun Apr 22 21:07:53 2012 (r992)
@@ -46,42 +46,9 @@
}
fi
-##
-# Returns 0 (success) if the given parameter names a directory, and that
-# directory is not empty.
-#
-contains_something()
-{
- if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ]
- then
- return 0
- else
- return 1
- fi
-}
-
-# read name from xen config file
-rdname()
+check_config_name()
{
- NM=$(xen create --quiet --dryrun --defconfig "$1" |
- sed -n 's/^.*(name \(.*\))$/\1/p')
-}
-
-rdnames()
-{
- NAMES=
- if ! contains_something "$XENDOMAINS_AUTO"
- then
- return
- fi
- for dom in $XENDOMAINS_AUTO/*; do
- rdname $dom
- if test -z $NAMES; then
- NAMES=$NM;
- else
- NAMES="$NAMES|$NM"
- fi
- done
+ xen create --quiet --dryrun --defconfig "$1" | sed -n 's/^.*(name \(.*\))$/\1/p'
}
check_running()
@@ -130,8 +97,7 @@
do_start_auto()
{
for file in $XENDOMAINS_AUTO/*; do
- rdname "$file"
- name="$NM"
+ name="$(check_config_name $file)"
log_action_begin_msg "Starting Xen domain $name ($file)"
if check_running "$name"; then
@@ -198,46 +164,6 @@
return 1
}
-check_all_auto_domains_up()
-{
- if ! contains_something "$XENDOMAINS_AUTO"
- then
- return 0
- fi
- missing=
- for nm in $XENDOMAINS_AUTO/*; do
- rdname $nm
- found=0
- if check_domain_up "$NM"; then
- echo -n " $name"
- else
- missing="$missing $NM"
- fi
- done
- if test -n "$missing"; then
- echo -n " MISS AUTO:$missing"
- return 1
- fi
- return 0
-}
-
-check_all_saved_domains_up()
-{
- if ! contains_something "$XENDOMAINS_SAVE"
- then
- return 0
- fi
- missing=`/bin/ls $XENDOMAINS_SAVE`
- echo -n " MISS SAVED: " $missing
- return 1
-}
-
-# This does NOT necessarily restart all running domains: instead it
-# stops all running domains and then boots all the domains specified in
-# AUTODIR. If other domains have been started manually then they will
-# not get restarted.
-# Commented out to avoid confusion!
-
case "$1" in
start)
do_start
More information about the Pkg-xen-changes
mailing list