From 1835d0f1f173d84df6f465bc722d4529a756c25f Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 9 Apr 2012 13:55:33 +0200 Subject: [PATCH] Issue another shutdown to cover occasional libvirt lack of attention (cherry picked from commit f63e6bb3f29005182b697806771a85f4a9ad81fa) --- src/vmm_mad/remotes/kvm/shutdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vmm_mad/remotes/kvm/shutdown b/src/vmm_mad/remotes/kvm/shutdown index 701eedd6d2..86f82002c9 100755 --- a/src/vmm_mad/remotes/kvm/shutdown +++ b/src/vmm_mad/remotes/kvm/shutdown @@ -25,6 +25,7 @@ source $(dirname $0)/../../scripts_common.sh #------------------------------------------------------------------------------ POLL_INTERVAL=2 TIMEOUT=300 +HALF_LOOP=$(($TIMEOUT/POLL_INTERVAL)) deploy_id=$1 @@ -47,6 +48,13 @@ do echo "Timeout reached" >&2 exit 1 fi + + # Issue another shutdown to cover occasional libvirt lack of attention + if [ "$count" -eq "$HALF_LOOP" ] + then + virsh --connect $LIBVIRT_URI shutdown $deploy_id + fi + let count=count+$POLL_INTERVAL done