From b12d9573260c50aa7da2aa2fd0be9ac8bdaa58d9 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 7 May 2012 17:03:33 +0200 Subject: [PATCH] bug #1151: Work on 1151 bug --- src/vmm_mad/remotes/kvm/shutdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vmm_mad/remotes/kvm/shutdown b/src/vmm_mad/remotes/kvm/shutdown index 8fbfebd63f..e3ccfbc628 100755 --- a/src/vmm_mad/remotes/kvm/shutdown +++ b/src/vmm_mad/remotes/kvm/shutdown @@ -25,11 +25,12 @@ deploy_id=$1 shutdown_command="virsh --connect $LIBVIRT_URI shutdown $deploy_id" +#If VM does not have ACPI enabled do not try to use it, destroy instead shutdown if [ "x$CANCEL_NO_ACPI" = "xyes" ]; then virsh --connect $LIBVIRT_URI dumpxml $deploy_id | grep -q acpi if [ "x$?" != "x0" ]; then - virsh --connect $LIBVIRT_URI destroy $deploy_id + shutdown_command="virsh --connect $LIBVIRT_URI destroy $deploy_id" fi fi @@ -46,7 +47,7 @@ function monitor # Issue another shutdown to cover occasional libvirt lack of attention if [ "$count" -eq "$HALF_LOOP" ] then - $($shutdown_command) + eval $shutdown_command fi let count=count+1