This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cluster Project branch, master, updated. cluster-2.99.06-45-ga4abbf1


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=a4abbf1dbfd3287ae70f3177d7d878919d80373b

The branch, master has been updated
       via  a4abbf1dbfd3287ae70f3177d7d878919d80373b (commit)
      from  b08565edfaf1580ce7e8c41e95d5aeda0c794d6e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a4abbf1dbfd3287ae70f3177d7d878919d80373b
Author: Lon Hohberger <lhh@redhat.com>
Date:   Tue Jul 22 11:01:53 2008 -0400

    [rgmanager] Add optional save/restore to vm resource
    
    This patch adds optional save/restore support to virtual machines.
    Patch Federico Simoncelli federico dot simoncelli at gmail dot com

-----------------------------------------------------------------------

Summary of changes:
 rgmanager/src/resources/vm.sh |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 15e1f2a..e72cbbb 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -211,6 +211,18 @@ meta_data()
             <content type="string" default="live"/>
         </parameter>
 
+	<parameter name="snapshot">
+	    <longdesc lang="en">
+	    	Path to the snapshot directory where the virtual machine
+		image will be stored.
+	    </longdesc>
+	    <shortdesc lang="en">
+	    	Path to the snapshot directory where the virtual machine
+		image will be stored.
+	    </shortdesc>
+            <content type="string" default=""/>
+        </parameter>
+
         <parameter name="depend">
             <longdesc lang="en">
 		Top-level service this depends on, in "service:name" format.
@@ -346,6 +358,8 @@ build_xm_cmdline()
 			;;
 		migrate)
 			;;
+		snapshot)
+			;;
 		*)
 			cmdline="$cmdline $varp=\"$val\""
 			;;
@@ -370,9 +384,21 @@ do_start()
 	# doesn't exist...
 	#
 	declare cmdline
+	declare snapshotimage
 
 	status && return 0
 
+	snapshotimage="$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
+
+        if [ -n "$OCF_RESKEY_snapshot" -a -f "$snapshotimage" ]; then
+		eval xm restore $snapshotimage
+		if [ $? -eq 0 ]; then
+			rm -f $snapshotimage
+			return 0
+		fi
+		return 1
+	fi
+
 	cmdline="`build_xm_cmdline`"
 
 	echo "# xm command line: $cmdline"
@@ -392,6 +418,10 @@ do_stop()
 	declare -i ret=1
 	declare st
 
+	if [ -n "$OCF_RESKEY_snapshot" ]; then
+		xm save $OCF_RESKEY_name "$OCF_RESKEY_snapshot/$OCF_RESKEY_name"
+	fi
+
 	for op in $*; do
 		echo xm $op $OCF_RESKEY_name ...
 		xm $op $OCF_RESKEY_name


hooks/post-receive
--
Cluster Project


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]