diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-10 13:35:41 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-10 13:35:41 -0300 |
commit | 3c0410a7dc71f30cfc814459ba62297a259c180d (patch) | |
tree | 5238d357b9b02345777be772f7b37dc6e0933086 | |
parent | 84af637b5cc0e67d58658469bcdfa42acd22c826 (diff) | |
download | kvmx-3c0410a7dc71f30cfc814459ba62297a259c180d.tar.gz kvmx-3c0410a7dc71f30cfc814459ba62297a259c180d.tar.bz2 |
Display spice log file; kvmx_spice: fixes PORT param and check if machine is running
-rwxr-xr-x | kvmx | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -30,6 +30,20 @@ KVMX_BASE="$DIRNAME" # Run spice client function kvmx_spice { + if ! kvmx_running; then + echo "$BASENAME: guest $VM is not running" + exit 1 + fi + + # Ensure we have the right port configuration: we can also be + # running directly from command line. + PORT="`cat $PORTFILE`" + + if [ -z "$PORT" ]; then + echo "$BASENAME: cannot get spice port for $VM." + exit 1 + fi + # https://lists.freedesktop.org/archives/spice-devel/2013-September/014643.html SPICE_NOGRAB=1 spicec --host localhost --port $PORT &> $SPICEFILE & #spicy -h localhost -p $PORT @@ -424,9 +438,24 @@ function kvmx_status { # Print guest log function kvmx_log { - if [ -e "$LOGFILE" ]; then + local blank_line="" + + if [ -s "$LOGFILE" ]; then + blank_line="1" + echo "In $LOGFILE:" + echo "" cat $LOGFILE fi + + if [ -s "$SPICEFILE" ]; then + if [ ! -z "$blank_line" ]; then + echo "" + fi + + echo "In $SPICEFILE:" + echo "" + cat $SPICEFILE + fi } # Dispatch |