[Pkg-xen-changes] r1108 - branches/wheezy/xen/debian

Bastian Blank waldi at alioth.debian.org
Tue Sep 18 10:56:51 UTC 2012


Author: waldi
Date: Tue Sep 18 10:56:51 2012
New Revision: 1108

Log:
* debian/changelog: Update.
* debian/xen-utils-common.xendomains.init:
  Show output of failed save and migrate.

Modified:
   branches/wheezy/xen/debian/changelog
   branches/wheezy/xen/debian/xen-utils-common.xendomains.init

Modified: branches/wheezy/xen/debian/changelog
==============================================================================
--- branches/wheezy/xen/debian/changelog	Tue Sep 18 08:32:53 2012	(r1107)
+++ branches/wheezy/xen/debian/changelog	Tue Sep 18 10:56:51 2012	(r1108)
@@ -1,7 +1,8 @@
 xen (4.1.3-3) UNRELEASED; urgency=low
 
-  * Make sure OpenVSwitch is started before any domains.
-  * Properly handle failed migrate and save in init script.
+  * Xen domain init script:
+    - Make sure Open vSwitch is started before any domain.
+    - Properly handle and show output failed migrate and save.
 
  -- Bastian Blank <waldi at debian.org>  Tue, 18 Sep 2012 10:08:54 +0200
 

Modified: branches/wheezy/xen/debian/xen-utils-common.xendomains.init
==============================================================================
--- branches/wheezy/xen/debian/xen-utils-common.xendomains.init	Tue Sep 18 08:32:53 2012	(r1107)
+++ branches/wheezy/xen/debian/xen-utils-common.xendomains.init	Tue Sep 18 10:56:51 2012	(r1108)
@@ -53,15 +53,28 @@
 
 timeout_coproc()
 {
-  local TIMEOUT="$1"
+  local TIMEOUT=$1
+  shift
+
+  coproc "$@" 2>&1 1>/dev/null
+
+  local COPROC_OUT
+  exec {COPROC_OUT}<&"${COPROC[0]}"
   local PID="$COPROC_PID"
+
   for no in $(seq 0 $TIMEOUT); do
     if [ -z "$COPROC_PID" ]; then break; fi
     sleep 1
     log_action_cont_msg
   done
+
   kill -INT "$COPROC_PID" >/dev/null 2>&1
   wait $PID
+  local rc=$?
+  log_action_end_msg $rc
+
+  [ $rc -gt 0 ] && cat <&$COPROC_OUT
+  exec <&$COPROC_OUT-
 }
 
 timeout_domain()
@@ -151,9 +164,7 @@
 
   while read id name rest; do
     log_action_begin_msg "Migrating Xen domain $name ($id)"
-    coproc xen migrate $id $XENDOMAINS_MIGRATE 2>&1 1>/dev/null
-    timeout_coproc "$XENDOMAINS_STOP_MAXWAIT"
-    log_action_end_msg $?
+    (timeout_coproc "$XENDOMAINS_STOP_MAXWAIT" xen migrate $id $XENDOMAINS_MIGRATE)
   done < <(/usr/lib/xen-common/bin/xen-init-list)
 }
 
@@ -164,9 +175,7 @@
 
   while read id name rest; do
     log_action_begin_msg "Saving Xen domain $name ($id)"
-    coproc xen save $id $XENDOMAINS_SAVE/$name 2>&1 1>/dev/null
-    timeout_coproc "$XENDOMAINS_STOP_MAXWAIT"
-    log_action_end_msg $?
+    (timeout_coproc "$XENDOMAINS_STOP_MAXWAIT" xen save $id $XENDOMAINS_SAVE/$name)
   done < <(/usr/lib/xen-common/bin/xen-init-list)
 }
 



More information about the Pkg-xen-changes mailing list