From: Silvio Rhatto Date: Thu, 16 Mar 2017 22:04:03 +0000 (-0300) Subject: adds kvmx_hibernate X-Git-Tag: 0.1.0~524 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=d20c87e198e00a62299047943dcc3d08deb6917c;p=kvmx.git adds kvmx_hibernate --- diff --git a/kvmx b/kvmx index 5379821..295256a 100755 --- 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