[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Use xm create's --dryrun option to get the name from the configuration file,



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 77d01909546d809b94f107dbbb0dd7cd1477181e
# Parent  436c3b6d09a62a837b43a091564c5452112efef5
Use xm create's --dryrun option to get the name from the configuration file,
rather than the eversoskanky approach taken previously (use grep, and replace
any occurrences of %d with [0-9]* !)

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 436c3b6d09a6 -r 77d01909546d tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Wed Dec  7 15:50:59 2005
+++ b/tools/examples/init.d/xendomains  Wed Dec  7 16:25:13 2005
@@ -152,7 +152,8 @@
 # read name from xen config file
 rdname()
 {
-    NM=`grep '^name *=' $1 | sed -e 's/^name *= *"\([^"]*\)".*$/\1/' -e 
's/%[id]/[0-9]*/g'`
+    NM=$(xm create --quiet --dryrun --defconfig "$1" |
+         sed -n 's/^.*(name \(.*\))$/\1/p')
 }
 
 rdnames()
@@ -220,6 +221,7 @@
                rm $dom
            fi
        done
+       echo .
     fi
 
     if contains_something "$XENDOMAINS_AUTO"

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.