diff options
-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 |