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-devel

[Xen-devel] [PATCH 4 of 4] always create a lockfile on xendomains servic

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4 of 4] always create a lockfile on xendomains service start
From: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
Date: Wed, 08 Jun 2011 17:45:16 -0400
Cc: zhigang.x.wang@xxxxxxxxxx
Delivery-date: Wed, 08 Jun 2011 14:50:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1307569512@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1307569512@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.8.4+40-99a7cd924636
# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
# Date 1307569509 14400
# Node ID ab0a7d100668a25f0e6f025b474694962e2e8aef
# Parent  b944852b97898ed11ea10eb9301efadc19ec50ca
always create a lockfile on xendomains service start

Currently if there's no saved VMs or VMs under /etc/xen/auto, the lockfile will
not be created.

If no lockfile, when system reboot, system will not wait xendomains service to
stop. Thus any running VMs without a link to /etc/xen/auto will not be cleanly
shutdown.

Signed-off-by: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>

diff -r b944852b9789 -r ab0a7d100668 tools/hotplug/Linux/init.d/xendomains
--- a/tools/hotplug/Linux/init.d/xendomains     Wed Jun 08 17:45:09 2011 -0400
+++ b/tools/hotplug/Linux/init.d/xendomains     Wed Jun 08 17:45:09 2011 -0400
@@ -249,8 +249,6 @@ start()
     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
@@ -276,7 +274,6 @@ start()
 
     if contains_something "$XENDOMAINS_AUTO"
     then
-       touch $LOCKFILE
        echo -n "Starting auto Xen domains:"
        # We expect config scripts for auto starting domains to be in
        # XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
@@ -305,6 +302,8 @@ start()
            fi
        done
     fi
+       mkdir -p $(dirname "$LOCKFILE")
+       touch $LOCKFILE
 }
 
 all_zombies()

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