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

diff --git a/kvmx b/kvmx
index 53798210309d26020ee399abfb8b6d4a1d1c2732..295256a3528c253ef533b09883f019ca9f6557fd 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -380,6 +380,20 @@ function kvmx_down {
   kvmx_poweroff
 }
 
+# Hibernate
+function kvmx_hibernate {
+  if ! kvmx_running; then
+    echo "$BASENAME: guest $VM is not running"
+    exit 1
+  fi
+
+  echo "which s2disk &> /dev/null && /usr/bin/sudo s2disk" | kvmx_ssh &> /dev/null
+
+  echo "Checking if guest is stopped..."
+  sleep 3
+  kvmx_status
+}
+
 # Reboot the guest
 function kvmx_reboot {
   if ! kvmx_running; then