diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-31 07:22:25 -0300 | 
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-31 07:22:25 -0300 | 
| commit | 89c1c94543c0acddd4712a1828c33cd10e735ae1 (patch) | |
| tree | 5d04bbc644a2803c39982138a38c27ee2cd8ec94 | |
| parent | e66c84f346b34916a9ac65d263c9951c5c36b918 (diff) | |
| download | kvmx-89c1c94543c0acddd4712a1828c33cd10e735ae1.tar.gz kvmx-89c1c94543c0acddd4712a1828c33cd10e735ae1.tar.bz2  | |
Implements log dir and spice pid file
| -rwxr-xr-x | kvmx | 15 | 
1 files changed, 10 insertions, 5 deletions
@@ -125,11 +125,13 @@ function __kvmx_initialize {      KVMX_PROJECT_FOLDER="`dirname $KVMXFILE`"      STORAGE="`dirname $image`"      STATE_DIR="$STORAGE/state/$VM" +    LOG_DIR="$STORAGE/log"      PIDFILE="$STATE_DIR/pid"      PORTFILE="$STATE_DIR/port"      SSHFILE="$STATE_DIR/ssh" -    LOGFILE="$STATE_DIR/log"      SPICEFILE="$STATE_DIR/spice" +    LOGFILE="$LOG_DIR/qemu" +    SPICELOG="$LOG_DIR/spice"      if [ -e "$STORAGE/ssh/$VM.key" ]; then        mkdir -p "$STORAGE/ssh" @@ -146,7 +148,7 @@ function __kvmx_initialize {      __kvmx_ssh_command $SSHKEY -    mkdir -p $STATE_DIR +    mkdir -p $STATE_DIR $LOG_DIR      if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "purge" ] && [ "$ACTION" != "destroy" ]; then        echo "$BASENAME: file not found: $image" @@ -172,10 +174,13 @@ function kvmx_spice {    fi    # https://lists.freedesktop.org/archives/spice-devel/2013-September/014643.html -  SPICE_NOGRAB=1 spicec --host localhost --port $PORT &> $SPICEFILE & +  SPICE_NOGRAB=1 spicec --host localhost --port $PORT &> $SPICELOG &    #spicy -h localhost -p $PORT    #remote-viewer spice://localhost:$PORT +  SPICEPID="$!" +  echo "$SPICEPID" > $SPICEFILE +    # Give time to connect    sleep 5 @@ -703,8 +708,8 @@ function kvmx_log {      logs="$logs $LOGFILE"    fi -  if [ -s "$SPICEFILE" ]; then -    logs="$logs $SPICEFILE" +  if [ -s "$SPICELOG" ]; then +    logs="$logs $SPICELOG"    fi    tail -F $logs  | 
