minor fixes
[tests.git] / system / template-qemu / qemu-start-node
index c0606f0..0b4eab4 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # cd in this command's directory
+COMMAND=$(basename $0)
 cd $(dirname $0)
 
 ########## globals
@@ -13,15 +14,13 @@ SCRIPT=qemu-ifup
 TAP="tap,script=$SCRIPT"
 
 ########## from the test environment
-# expected vars are MACADDR, NODE_ISO, HOSTNAME and TARGET_ARCH
+# expected vars are MACADDR, NODE_ISO, HOSTNAME, IP and TARGET_ARCH
 CONFIG=qemu.conf
-if [ ! -e ${CONFIG} ];then
-    echo "File for node_iso version not found"
-    exit 1
-fi
+[ -f "$CONFIG" ] || { echo "Config file for qemu $CONFIG not found in $(pwd)" ; exit 1 ; }
 . $CONFIG
 
 # the launcher, depending on local/target archs
+# make sure to check qemu-kill-node for consistency
 archs="$(uname -i)+$TARGET_ARCH"
 case $archs in
     i386+i386)         QEMU=qemu;;
@@ -30,6 +29,9 @@ case $archs in
     x86_64+x86_64)     QEMU=qemu-system-x86_64;;
 esac
 
+echo "Running $COMMAND in $(pwd)"
+echo "Starting at $(date)"
+
 #Creating new HDA if needed only
 #using qcow2 disk image format which is essential to support VM snapshots
 if [ -f $HDA ] ; then