diff --git a/src/image_mad/remotes/fs/cp b/src/image_mad/remotes/fs/cp index 2ef4f8a2d8..78d3236276 100755 --- a/src/image_mad/remotes/fs/cp +++ b/src/image_mad/remotes/fs/cp @@ -39,12 +39,14 @@ DST=$2 case $SRC in http://*) log "Downloading $SRC to the image repository" - exec_and_log "$WGET -O $DST $SRC" + exec_and_log "$WGET -O $DST $SRC" \ + "Error downloading $SRC" ;; *) log "Copying local image $SRC to the image repository" - exec_and_log "cp -f $SRC $DST" + exec_and_log "cp -f $SRC $DST" \ + "Error copying $SRC to $DST" ;; esac diff --git a/src/image_mad/remotes/fs/mkfs b/src/image_mad/remotes/fs/mkfs index e57fd2fce5..e6b1949366 100755 --- a/src/image_mad/remotes/fs/mkfs +++ b/src/image_mad/remotes/fs/mkfs @@ -37,6 +37,8 @@ DST=$1 FSTYPE=$2 SIZE=$3 -exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" -exec_and_log "$MKFS -t $FSTYPE -F $DST" +exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \ + "Could not create image $DST" +exec_and_log "$MKFS -t $FSTYPE -F $DST" \ + "Unable to create filesystem $FSTYPE in $DST" exec_and_log "chmod 0660 $DST" diff --git a/src/image_mad/remotes/fs/mv b/src/image_mad/remotes/fs/mv index a1e2eadd3f..74ee2f7199 100755 --- a/src/image_mad/remotes/fs/mv +++ b/src/image_mad/remotes/fs/mv @@ -39,12 +39,14 @@ DST=$2 case $SRC in http://*) log "Downloading $SRC to the image repository" - exec_and_log "$WGET -O $DST $SRC" + exec_and_log "$WGET -O $DST $SRC" \ + "Error downloading $SRC" ;; *) log "Moving local image $SRC to the image repository" - exec_and_log "mv -f $SRC $DST" + exec_and_log "mv -f $SRC $DST" \ + "Could not move $SRC to $DST" ;; esac diff --git a/src/image_mad/remotes/fs/rm b/src/image_mad/remotes/fs/rm index 5526887226..72b66573d2 100755 --- a/src/image_mad/remotes/fs/rm +++ b/src/image_mad/remotes/fs/rm @@ -36,5 +36,6 @@ SRC=$1 if [ -e $SRC ] ; then log "Removing $SRC from the image repository" - exec_and_log "rm $SRC" + exec_and_log "rm $SRC" \ + "Error deleting $SRC" fi diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index 0e5a9781a6..455f83b529 100755 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -83,20 +83,29 @@ function error_message ) 1>&2 } -# Executes a command, if it fails return error message and exits +# Executes a command, if it fails returns error message and exits +# If a second parameter is present it is used as the error message when +# the command fails function exec_and_log { + message=$2 output=`$1 2>&1 1>/dev/null` code=$? if [ "x$code" != "x0" ]; then log_error "Command \"$1\" failed." log_error "$output" - error_message "$output" + if [ -n "$message" ]; then + error_message "$output" + else + error_message "$message" + fi exit $code fi log "Executed \"$1\"." } + + # Like exec_and_log but the first argument is the number of seconds # before here is timeout and kills the command # diff --git a/src/tm_mad/nfs/tm_clone.sh b/src/tm_mad/nfs/tm_clone.sh index b54c826517..62c33fc2e8 100755 --- a/src/tm_mad/nfs/tm_clone.sh +++ b/src/tm_mad/nfs/tm_clone.sh @@ -34,8 +34,8 @@ DST_PATH=`arg_path $DST` fix_paths -log "$1 $2" -log "DST: $DST_PATH" +log_debug "$1 $2" +log_debug "DST: $DST_PATH" DST_DIR=`dirname $DST_PATH` @@ -46,12 +46,14 @@ exec_and_log "chmod a+w $DST_DIR" case $SRC in http://*) log "Downloading $SRC" - exec_and_log "$WGET -O $DST_PATH $SRC" + exec_and_log "$WGET -O $DST_PATH $SRC" \ + "Error downloading $SRC" ;; *) log "Cloning $SRC_PATH" - exec_and_log "cp -r $SRC_PATH $DST_PATH" + exec_and_log "cp -r $SRC_PATH $DST_PATH" \ + "Error copying $SRC to $DST" ;; esac diff --git a/src/tm_mad/nfs/tm_context.sh b/src/tm_mad/nfs/tm_context.sh index b079622054..f211024f3d 100755 --- a/src/tm_mad/nfs/tm_context.sh +++ b/src/tm_mad/nfs/tm_context.sh @@ -48,16 +48,19 @@ exec_and_log "mkdir -p $ISO_DIR" for f in $SRC; do case $f in http://*) - exec_and_log "$WGET -O $ISO_DIR $f" + exec_and_log "$WGET -O $ISO_DIR $f" \ + "Error downloading $f" ;; *) - exec_and_log "cp -R $f $ISO_DIR" + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" ;; esac done -exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR" +exec_and_log "$MKISOFS -o $DST_PATH -J -R $ISO_DIR" \ + "Error creating iso fs" exec_and_log "rm -rf $ISO_DIR" diff --git a/src/tm_mad/nfs/tm_delete.sh b/src/tm_mad/nfs/tm_delete.sh index cf1ff88742..942e0678cf 100755 --- a/src/tm_mad/nfs/tm_delete.sh +++ b/src/tm_mad/nfs/tm_delete.sh @@ -34,4 +34,5 @@ SRC_PATH=`arg_path $SRC` fix_src_path log "Deleting $SRC_PATH" -exec_and_log "rm -rf $SRC_PATH" +exec_and_log "rm -rf $SRC_PATH" \ + "Error deleting $SRC_PATH" diff --git a/src/tm_mad/nfs/tm_ln.sh b/src/tm_mad/nfs/tm_ln.sh index 33b4a2a21c..1a3578e7b6 100755 --- a/src/tm_mad/nfs/tm_ln.sh +++ b/src/tm_mad/nfs/tm_ln.sh @@ -37,7 +37,8 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` log "Creating directory $DST_DIR" -exec_and_log "mkdir -p $DST_DIR" +exec_and_log "mkdir -p $DST_DIR" \ + "Could not create directory $DST_DIR" exec_and_log "chmod a+w $DST_DIR" log "Link $SRC_PATH" diff --git a/src/tm_mad/nfs/tm_mkimage.sh b/src/tm_mad/nfs/tm_mkimage.sh index ddafb405ec..b30c0ff327 100755 --- a/src/tm_mad/nfs/tm_mkimage.sh +++ b/src/tm_mad/nfs/tm_mkimage.sh @@ -36,8 +36,11 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` -exec_and_log "mkdir -p $DST_DIR" -exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" -exec_and_log "$MKFS -t $FSTYPE -F $DST_PATH" +exec_and_log "mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" +exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image $DST_PATH" +exec_and_log "$MKFS -t $FSTYPE -F $DST_PATH" \ + "Unable to create filesystem $FSTYPE in $DST_PATH" exec_and_log "chmod a+rw $DST_PATH" diff --git a/src/tm_mad/nfs/tm_mkswap.sh b/src/tm_mad/nfs/tm_mkswap.sh index af78a59087..58b1e286fb 100755 --- a/src/tm_mad/nfs/tm_mkswap.sh +++ b/src/tm_mad/nfs/tm_mkswap.sh @@ -35,15 +35,17 @@ fix_dst_path DST_DIR=`dirname $DST_PATH` -log "Creating directory $DST_DIR" +log_debug "Creating directory $DST_DIR" exec_and_log "mkdir -p $DST_DIR" exec_and_log "chmod a+w $DST_DIR" -log "Creating ${SIZE}Mb image in $DST_PATH" -exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" +log_debug "Creating ${SIZE}Mb image in $DST_PATH" +exec_and_log "$DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image file $DST_PATH" -log "Initializing swap space" -exec_and_log "$MKSWAP $DST_PATH" +log_debug "Initializing swap space" +exec_and_log "$MKSWAP $DST_PATH" \ + "Could not create swap on $DST_PATH" exec_and_log "chmod a+w $DST_PATH" diff --git a/src/tm_mad/nfs/tm_mv.sh b/src/tm_mad/nfs/tm_mv.sh index 68902f969b..23483b6655 100755 --- a/src/tm_mad/nfs/tm_mv.sh +++ b/src/tm_mad/nfs/tm_mv.sh @@ -43,7 +43,8 @@ else log "Will not move, is not saving image" else log "Moving $SRC_PATH" - exec_and_log "mv $SRC_PATH $DST_PATH" + exec_and_log "mv $SRC_PATH $DST_PATH" \ + "Could not move $SRC_PATH to $DST_PATH" fi fi diff --git a/src/tm_mad/ssh/tm_clone.sh b/src/tm_mad/ssh/tm_clone.sh index 8507c43e0a..71800d1874 100755 --- a/src/tm_mad/ssh/tm_clone.sh +++ b/src/tm_mad/ssh/tm_clone.sh @@ -34,23 +34,26 @@ SRC_HOST=`arg_host $SRC` DST_HOST=`arg_host $DST` -log "$1 $2" -log "DST: $DST_PATH" +log_debug "$1 $2" +log_debug "DST: $DST_PATH" DST_DIR=`dirname $DST_PATH` log "Creating directory $DST_DIR" -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" case $SRC in http://*) log "Downloading $SRC" - exec_and_log "$SSH $DST_HOST $WGET -O $DST_PATH $SRC" + exec_and_log "$SSH $DST_HOST $WGET -O $DST_PATH $SRC" \ + "Error downloading $SRC" ;; *) log "Cloning $SRC" - exec_and_log "$SCP $SRC $DST" + exec_and_log "$SCP $SRC $DST" \ + "Error copying $SRC to $DST" ;; esac diff --git a/src/tm_mad/ssh/tm_context.sh b/src/tm_mad/ssh/tm_context.sh index ee7fd40603..322ebdaf1b 100755 --- a/src/tm_mad/ssh/tm_context.sh +++ b/src/tm_mad/ssh/tm_context.sh @@ -47,21 +47,27 @@ fi ISO_DIR="$TMP_DIR/isofiles" -exec_and_log "mkdir -p $ISO_DIR" +exec_and_log "mkdir -p $ISO_DIR" \ + "Error creating directory $ISO_DIR" for f in $SRC; do case $f in http://*) - exec_and_log "$WGET -O $ISO_DIR $f" + exec_and_log "$WGET -O $ISO_DIR $f" \ + "Error downloading $f" ;; *) - exec_and_log "cp -R $f $ISO_DIR" + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" ;; esac done -exec_and_log "$MKISOFS -o $TMP_DIR/$DST_FILE -J -R $ISO_DIR" -exec_and_log "$SCP $TMP_DIR/$DST_FILE $DST" -exec_and_log "rm -rf $TMP_DIR" +exec_and_log "$MKISOFS -o $TMP_DIR/$DST_FILE -J -R $ISO_DIR" \ + "Error creating iso fs" +exec_and_log "$SCP $TMP_DIR/$DST_FILE $DST" \ + "Error copying $TMP_DIR/$DST_FILE to $DST" +exec_and_log "rm -rf $TMP_DIR" \ + "Error deleting $TMP_DIR" diff --git a/src/tm_mad/ssh/tm_delete.sh b/src/tm_mad/ssh/tm_delete.sh index f0c7205a43..0824634ebd 100755 --- a/src/tm_mad/ssh/tm_delete.sh +++ b/src/tm_mad/ssh/tm_delete.sh @@ -31,4 +31,5 @@ SRC_PATH=`arg_path $SRC` SRC_HOST=`arg_host $SRC` log "Deleting $SRC_PATH" -exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" +exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" \ + "Error deleting $SRC_PATH" diff --git a/src/tm_mad/ssh/tm_mkimage.sh b/src/tm_mad/ssh/tm_mkimage.sh index d092a8b9b2..81ff20f32c 100755 --- a/src/tm_mad/ssh/tm_mkimage.sh +++ b/src/tm_mad/ssh/tm_mkimage.sh @@ -32,7 +32,10 @@ DST_PATH=`arg_path $DST` DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" -exec_and_log "$SSH $DST_HOST $MKFS -t $FSTYPE -F $DST_PATH" -exec_and_log "$SSH $DST_HOST chmod a+rw $DST_PATH" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Error creating directory $DST_DIR" +exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image $DST_PATH" +exec_and_log "$SSH $DST_HOST $MKFS -t $FSTYPE -F $DST_PATH" \ + "Unable to create filesystem $FSTYPE in $DST_PATH" +exec_and_log "$SSH $DST_HOST chmod a+rw $DST_PATH" \ No newline at end of file diff --git a/src/tm_mad/ssh/tm_mkswap.sh b/src/tm_mad/ssh/tm_mkswap.sh index 046a277bbc..60705134aa 100755 --- a/src/tm_mad/ssh/tm_mkswap.sh +++ b/src/tm_mad/ssh/tm_mkswap.sh @@ -34,10 +34,12 @@ DST_DIR=`dirname $DST_PATH` log "Creating ${SIZE}Mb image in $DST_PATH" exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" +exec_and_log "$SSH $DST_HOST $DD if=/dev/zero of=$DST_PATH bs=1 count=1 seek=${SIZE}M" \ + "Could not create image file $DST_PATH" log "Initializing swap space" -exec_and_log "$SSH $DST_HOST $MKSWAP $DST_PATH" +exec_and_log "$SSH $DST_HOST $MKSWAP $DST_PATH" \ + "Could not create swap on $DST_PATH" exec_and_log "$SSH $DST_HOST chmod a+w $DST_PATH" diff --git a/src/tm_mad/ssh/tm_mv.sh b/src/tm_mad/ssh/tm_mv.sh index 6d3ff82065..3f10354e8b 100755 --- a/src/tm_mad/ssh/tm_mv.sh +++ b/src/tm_mad/ssh/tm_mv.sh @@ -36,6 +36,8 @@ DST_HOST=`arg_host $DST` DST_DIR=`dirname $DST_PATH` log "Moving $SRC_PATH" -exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" -exec_and_log "$SCP -r $SRC $DST" +exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \ + "Unable to create directory $DST_DIR" +exec_and_log "$SCP -r $SRC $DST" \ + "Could not copy $SRC to $DST" exec_and_log "$SSH $SRC_HOST rm -rf $SRC_PATH" diff --git a/src/vmm_mad/remotes/kvm/cancel b/src/vmm_mad/remotes/kvm/cancel index 11bbffe5db..cbcdad3eb7 100755 --- a/src/vmm_mad/remotes/kvm/cancel +++ b/src/vmm_mad/remotes/kvm/cancel @@ -17,7 +17,9 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 -virsh --connect $LIBVIRT_URI destroy $deploy_id +exec_and_log "virsh --connect $LIBVIRT_URI destroy $deploy_id" \ + "Could not destroy $deploy_id" diff --git a/src/vmm_mad/remotes/kvm/deploy b/src/vmm_mad/remotes/kvm/deploy index fe611ce7d0..dd39ead402 100755 --- a/src/vmm_mad/remotes/kvm/deploy +++ b/src/vmm_mad/remotes/kvm/deploy @@ -17,6 +17,7 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh domain=$1 @@ -28,5 +29,6 @@ data=`virsh --connect $LIBVIRT_URI create $domain` if [ "x$?" = "x0" ]; then echo $data | sed 's/Domain //' | sed 's/ created from .*$//' else + error_message "Could not create domain from $domain" exit -1 fi diff --git a/src/vmm_mad/remotes/kvm/migrate b/src/vmm_mad/remotes/kvm/migrate index 1f95602bc4..2dbdf8a521 100755 --- a/src/vmm_mad/remotes/kvm/migrate +++ b/src/vmm_mad/remotes/kvm/migrate @@ -17,8 +17,10 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 dest_host=$2 -virsh --connect $LIBVIRT_URI migrate --live $deploy_id $QEMU_PROTOCOL://$dest_host/system +exec_and_log "virsh --connect $LIBVIRT_URI migrate --live $deploy_id $QEMU_PROTOCOL://$dest_host/system" \ + "Could not migrate $deploy_id to $dest_host" diff --git a/src/vmm_mad/remotes/kvm/restore b/src/vmm_mad/remotes/kvm/restore index 8a83fc92b5..761a82227a 100755 --- a/src/vmm_mad/remotes/kvm/restore +++ b/src/vmm_mad/remotes/kvm/restore @@ -17,7 +17,9 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh file=$1 -virsh --connect $LIBVIRT_URI restore $file +exec_and_log "virsh --connect $LIBVIRT_URI restore $file" \ + "Could not restore from $file" diff --git a/src/vmm_mad/remotes/kvm/save b/src/vmm_mad/remotes/kvm/save index b51735188f..4b09cf7fc4 100755 --- a/src/vmm_mad/remotes/kvm/save +++ b/src/vmm_mad/remotes/kvm/save @@ -17,6 +17,7 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 file=$2 @@ -26,4 +27,5 @@ if [ ! -f $file ]; then chmod 666 $file fi -virsh --connect $LIBVIRT_URI save $deploy_id $file +exec_and_log "virsh --connect $LIBVIRT_URI save $deploy_id $file" \ + "Could not save $deploy_id to $file" diff --git a/src/vmm_mad/remotes/kvm/shutdown b/src/vmm_mad/remotes/kvm/shutdown index e7d4c8d7a4..bd2491ab2f 100755 --- a/src/vmm_mad/remotes/kvm/shutdown +++ b/src/vmm_mad/remotes/kvm/shutdown @@ -17,6 +17,7 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/kvmrc +source $(dirname $0)/../../scripts_common.sh #------------------------------------------------------------------------------ # Wait the VM to shutdown TIMEOUT (xPOLL_INTERVAL) seconds. @@ -32,6 +33,7 @@ virsh --connect $LIBVIRT_URI shutdown $deploy_id exit_code=$? if [ "$exit_code" != "0" ]; then + error_message "Could not shutdown $deploy_id" exit $exit_code fi @@ -41,6 +43,7 @@ do sleep $POLL_INTERVAL if [ "$count" -gt "$TIMEOUT" ] then + error_message "Timeout reached and VM $deploy_id is still alive" echo "Timeout reached" >&2 exit 1 fi diff --git a/src/vmm_mad/remotes/xen/cancel b/src/vmm_mad/remotes/xen/cancel index b8c0a484c2..4beab6b21c 100755 --- a/src/vmm_mad/remotes/xen/cancel +++ b/src/vmm_mad/remotes/xen/cancel @@ -17,7 +17,9 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 -$XM_CANCEL $deploy_id +exec_and_log "$XM_CANCEL $deploy_id" \ + "Could not destroy $deploy_id" diff --git a/src/vmm_mad/remotes/xen/deploy b/src/vmm_mad/remotes/xen/deploy index 99c771c6fe..b91569c1cc 100755 --- a/src/vmm_mad/remotes/xen/deploy +++ b/src/vmm_mad/remotes/xen/deploy @@ -17,10 +17,13 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh function error_exit() { exit_code=$1 + message=$2 if [ "x$exit_code" != "x0" ]; then + error_message $message exit $exit_code fi } @@ -32,7 +35,7 @@ cat > $domain output=`$XM_CREATE $domain` -error_exit $? +error_exit $? "Unable to create domain" domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n'` @@ -41,11 +44,13 @@ out=`grep -e '^\#O CPU_CREDITS =' < $domain` if [ "x$?" = "x0" ]; then credits=`echo $out | cut -d= -f2 | tr -d ' '` + log_debug "Credits set to $credits" + name=`grep -e '^name =' < $domain | cut -d= -f2 | tr -d ' ' | tr -d "\'"` $XM_CREDITS -d $name -w $credits - error_exit $? + error_exit $? "Unable to set VM credits" fi echo $domain_name diff --git a/src/vmm_mad/remotes/xen/migrate b/src/vmm_mad/remotes/xen/migrate index bd5c074799..6458d3b542 100755 --- a/src/vmm_mad/remotes/xen/migrate +++ b/src/vmm_mad/remotes/xen/migrate @@ -17,8 +17,10 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 dest_host=$2 -$XM_MIGRATE $deploy_id $dest_host +exec_and_log "$XM_MIGRATE $deploy_id $dest_host" \ + "Could not migrate $deploy_id to $dest_host" diff --git a/src/vmm_mad/remotes/xen/restore b/src/vmm_mad/remotes/xen/restore index c92cb1e1ec..aa4bc0402b 100755 --- a/src/vmm_mad/remotes/xen/restore +++ b/src/vmm_mad/remotes/xen/restore @@ -17,8 +17,10 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh file=$1 -$XM_RESTORE $file +exec_and_log "$XM_RESTORE $file" \ + "Could not restore from $file" diff --git a/src/vmm_mad/remotes/xen/save b/src/vmm_mad/remotes/xen/save index fc653c569f..7be9ce93cc 100755 --- a/src/vmm_mad/remotes/xen/save +++ b/src/vmm_mad/remotes/xen/save @@ -17,9 +17,10 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 file=$2 -$XM_SAVE $deploy_id $file - +exec_and_log "$XM_SAVE $deploy_id $file" \ + "Could not save $deploy_id to $file" diff --git a/src/vmm_mad/remotes/xen/shutdown b/src/vmm_mad/remotes/xen/shutdown index 9d3ca25367..d6b240672c 100755 --- a/src/vmm_mad/remotes/xen/shutdown +++ b/src/vmm_mad/remotes/xen/shutdown @@ -17,6 +17,7 @@ #--------------------------------------------------------------------------- # source $(dirname $0)/xenrc +source $(dirname $0)/../../scripts_common.sh deploy_id=$1 @@ -24,7 +25,8 @@ function gdm { $XM_LIST | grep "$deploy_id " } -$XM_SHUTDOWN $deploy_id || exit -1 +exec_and_log "$XM_SHUTDOWN $deploy_id" \ + "Could not shutdown $deploy_id" OUT=$(gdm)