]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Better check at kvmx_hibernate
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Mar 2017 22:23:48 +0000 (19:23 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Mar 2017 22:23:48 +0000 (19:23 -0300)
kvmx

diff --git a/kvmx b/kvmx
index 295256a3528c253ef533b09883f019ca9f6557fd..a6bd52cdf47a470da3ad0272748deb6ffd6e41ec 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -389,9 +389,15 @@ function kvmx_hibernate {
 
   echo "which s2disk &> /dev/null && /usr/bin/sudo s2disk" | kvmx_ssh &> /dev/null
 
-  echo "Checking if guest is stopped..."
+  echo "Checking if hibernation was successful..."
   sleep 3
-  kvmx_status
+
+  if kvmx_running; then
+    echo "Unable to hibernate guest: please check guest configuration"
+    exit 1
+  else
+    kvmx_status
+  fi
 }
 
 # Reboot the guest