WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xendomains: Better sanity checking of pot

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xendomains: Better sanity checking of potetntial save records.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 03 Jul 2007 13:30:51 -0700
Delivery-date: Tue, 03 Jul 2007 13:29:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183453942 -3600
# Node ID 356bd2f3b9d805df5c59d1758832369183d2ddda
# Parent  a836f4bc86fdfa84a169b0135486a8a6b0c1d516
xendomains: Better sanity checking of potetntial save records.
Signed-off-by: Gawain Lynch <gawain.lynch@xxxxxxxxx>
---
 tools/examples/init.d/xendomains |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff -r a836f4bc86fd -r 356bd2f3b9d8 tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Tue Jul 03 10:08:34 2007 +0100
+++ b/tools/examples/init.d/xendomains  Tue Jul 03 10:12:22 2007 +0100
@@ -221,22 +221,26 @@ start()
     if [ "$XENDOMAINS_RESTORE" = "true" ] &&
        contains_something "$XENDOMAINS_SAVE"
     then
-       XENDOMAINS_SAVED=`/bin/ls $XENDOMAINS_SAVE/* | grep -v 'lost+found'`
        mkdir -p $(dirname "$LOCKFILE")
        touch $LOCKFILE
        echo -n "Restoring Xen domains:"
        saved_domains=`ls $XENDOMAINS_SAVE`
-       for dom in $XENDOMAINS_SAVED; do
-           echo -n " ${dom##*/}"
-           xm restore $dom
-           if [ $? -ne 0 ]; then
-               rc_failed $?
-               echo -n '!'
-           else
-               # mv $dom ${dom%/*}/.${dom##*/}
-               rm $dom
-           fi
-       done
+        for dom in $XENDOMAINS_SAVE/*; do
+            if [ -f $dom ] ; then
+                HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`
+                if [ $HEADER = "LinuxGuestRecord" ]; then
+                    echo -n " ${dom##*/}"
+                    xm restore $dom
+                    if [ $? -ne 0 ]; then
+                        rc_failed $?
+                        echo -n '!'
+                    else
+                        # mv $dom ${dom%/*}/.${dom##*/}
+                        rm $dom
+                    fi
+                fi
+            fi
+        done
        echo .
     fi
 
@@ -260,7 +264,6 @@ start()
            if [ $? -eq 0 ] || is_running $dom; then
                echo -n "(skip)"
            else
-               echo "(booting)"
                xm create --quiet --defconfig $dom
                if [ $? -ne 0 ]; then
                    rc_failed $?

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xendomains: Better sanity checking of potetntial save records., Xen patchbot-unstable <=