diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-12-31 00:32:39 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-12-31 00:32:39 -0200 |
commit | 1a6e0fbacae260fe702ae9b7ea098985ffb3e0cf (patch) | |
tree | 90003205c01093e2887c8a8a2d1336112fadf1db | |
parent | 96d5ab24e590bac3df111bdcf9c0ded7a0573473 (diff) | |
download | kvmx-1a6e0fbacae260fe702ae9b7ea098985ffb3e0cf.tar.gz kvmx-1a6e0fbacae260fe702ae9b7ea098985ffb3e0cf.tar.bz2 |
Use qemu monitor at kvmx_poweroff when ssh_support is off
-rwxr-xr-x | kvmx | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -621,6 +621,9 @@ function kvmx_suspend { PID="`cat $PIDFILE`" kill -STOP $PID + # Alternative + #kvmx_monitor stop + SPICEPID="`cat $SPICEFILE`" if ps $SPICEPID &> /dev/null; then @@ -671,6 +674,9 @@ function kvmx_resume { PID="`cat $PIDFILE`" kill -CONT $PID + + # Alternative + #kvmx_monitor system_wakeup } # Poweroff the guest @@ -684,7 +690,12 @@ function kvmx_poweroff { $DIRNAME/$BASENAME xpra $VM stop fi - echo /usr/bin/sudo poweroff | kvmx_ssh &> /dev/null + if [ "$ssh_support" == "y" ]; then + echo /usr/bin/sudo poweroff | kvmx_ssh &> /dev/null + else + kvmx_monitor system_powerdown + fi + kvmx_xephyr_stop sleep 3 kvmx_status @@ -707,6 +718,11 @@ function kvmx_hibernate { exit 1 fi + if [ "$ssh_support" != "y" ]; then + echo "$BASENAME: ssh_support is disabled for guest $VM" + exit 1 + fi + if ! kvmx_ssh test -s /swapfile; then echo "Seems like /swapfile is absent in the guest, aborting" exit 1 @@ -1466,7 +1482,13 @@ function kvmx_monitor { exit 1 fi - socat $MONITORFILE STDIO + if [ -z "$1" ]; then + socat $MONITORFILE STDIO + else + socat STDIO $MONITORFILE <<EOF +$1 +EOF + fi } # Install system |