return 1
}
+#--------------
+#Install a file
+#--------------
+install_file()
+{
+ SRC="$1"
+ DST="$2"
+
+ file_unwind()
+ {
+ do_cmd umount /mnt/xenclient/storage 2>/dev/null
+ do_cmd umount /mnt/xenclient
+ return 1 # this enables "file_unwind || return 1" for error handling below
+ }
+
+ mkdir -p /mnt/xenclient || return 1
+ do_cmd mount /dev/xenclient/root /mnt/xenclient >&2 || return 1
+ do_cmd mount /dev/xenclient/storage /mnt/xenclient/storage >&2 || file_unwind || return 1
+
+ cp "${SRC}" "/mnt/xenclient/${DST}" || file_unwind || return 1
+
+
+ file_unwind
+
+ return 0
+}
+
+
+
#-----------------------------------------------------------
# IOVM install/upgrade function
# This function will erase any previous existing IOVM
COMPONENT="$(echo "${LINE}" | cut -f1 -d,)"
PACKAGE_TYPE="$(echo "${LINE}" | cut -f4 -d,)"
FILENAME="$(echo "${LINE}" | cut -f6 -d,)"
+ DESTINATION="$(echo "${LINE}" | cut -f7 -d,)"
"${func_to_run}" || return "$?"
done