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] This patch checks the contents of XENDOMA

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] This patch checks the contents of XENDOMAINS_SAVE before the restore
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Dec 2006 13:20:30 +0000
Delivery-date: Fri, 08 Dec 2006 05:22:20 -0800
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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID a330509abb20982fc75fb5fa66155d9bb09225f9
# Parent  e98c84468b725d57369b774d6baba3a62fde3a9c
This patch checks the contents of XENDOMAINS_SAVE before the restore
process begins, and prevents xendomains from attempting to start any
domain that appears there, whether the domain started successfully or
not.

Signed off by: Hugh Brock <hbrock@xxxxxxxxxx>
---
 tools/examples/init.d/xendomains |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -r e98c84468b72 -r a330509abb20 tools/examples/init.d/xendomains
--- a/tools/examples/init.d/xendomains  Thu Dec 07 12:15:30 2006 +0000
+++ b/tools/examples/init.d/xendomains  Thu Dec 07 12:23:35 2006 +0000
@@ -204,12 +204,14 @@ start()
        return; 
     fi
 
+    saved_domains=" "
     if [ "$XENDOMAINS_RESTORE" = "true" ] &&
        contains_something "$XENDOMAINS_SAVE"
     then
         mkdir -p $(dirname "$LOCKFILE")
        touch $LOCKFILE
        echo -n "Restoring Xen domains:"
+       saved_domains=`ls $XENDOMAINS_SAVE`
        for dom in $XENDOMAINS_SAVE/*; do
            echo -n " ${dom##*/}"
            xm restore $dom
@@ -234,9 +236,14 @@ start()
        # Create all domains with config files in XENDOMAINS_AUTO.
        # TODO: We should record which domain name belongs 
        # so we have the option to selectively shut down / migrate later
+       # If a domain statefile from $XENDOMAINS_SAVE matches a domain name
+       # in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't 
+       # restore correctly it requires administrative attention.
        for dom in $XENDOMAINS_AUTO/*; do
            echo -n " ${dom##*/}"
-           if is_running $dom; then
+           shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p')
+           echo $saved_domains | grep -w $shortdom > /dev/null
+           if [ $? -eq 0 ] || is_running $dom; then
                echo -n "(skip)"
            else
                xm create --quiet --defconfig $dom

_______________________________________________
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] This patch checks the contents of XENDOMAINS_SAVE before the restore, Xen patchbot-unstable <=