1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

L #-: Lint qcow2/* TM files (#1257)

This commit is contained in:
Jan Orel 2021-05-28 11:19:05 +02:00 committed by GitHub
parent b58996d67c
commit 966adb87b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 27 deletions

View File

@ -28,10 +28,8 @@ SRC=$1
DST=$2
if [ -z "${ONE_LOCATION}" ]; then
LIB_LOCATION=/usr/lib/one
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
else
LIB_LOCATION=$ONE_LOCATION/lib
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
fi

View File

@ -26,9 +26,6 @@
SRC=$1
DST=$2
VMID=$3
DSID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
else
@ -37,23 +34,17 @@ fi
. $TMCOMMON
SRC=`fix_dir_slashes $SRC`
DST=`fix_dir_slashes $DST`
SRC=$(fix_dir_slashes $SRC)
DST=$(fix_dir_slashes $DST)
SRC_PATH=`arg_path $SRC`
DST_PATH=`arg_path $DST`
SRC_PATH=$(arg_path $SRC)
DST_PATH=$(arg_path $DST)
SRC_HOST=`arg_host $SRC`
DST_HOST=`arg_host $DST`
DST_DIR=`dirname $DST_PATH`
SRC_DS_DIR=`dirname $SRC_PATH`
SRC_VM_DIR=`basename $SRC_PATH`
DST_HOST=$(arg_host $DST)
# Return if moving a disk, we will move them when moving the whole system_ds
# directory for the VM
if [ `is_disk $DST_PATH` -eq 1 ]; then
if [ "$(is_disk $DST_PATH)" -eq 1 ]; then
exit 0
fi

View File

@ -21,14 +21,11 @@
SRC=$1
SNAP_ID=$2
VMID=$3
DSID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
DATASTORES=/var/lib/one/datastores
else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
DATASTORES=$ONE_LOCATION/var/datastores
fi
DRIVER_PATH=$(dirname $0)
@ -62,7 +59,6 @@ FORMAT="${XPATH_ELEMENTS[j++]}"
SYSTEM_DS_PATH=$(dirname ${SRC_PATH})
SYSTEM_DS_DISK_PATH="${SYSTEM_DS_PATH}/disk.${DISK_ID}"
SYSTEM_DS_DISK_PATH_SHORT="disk.${DISK_ID}"
if [ "$CLONE" = "YES" ]; then
DISK_PATH="${SYSTEM_DS_DISK_PATH}"
@ -76,7 +72,7 @@ SNAP_DIR="${DISK_PATH}.snap"
SNAP_DIR_SHORT="${DISK_PATH_SHORT}.snap"
if [ "$FORMAT" = "qcow2" ]; then
NEXT_SNAP_ID=$(($SNAP_ID+1))
NEXT_SNAP_ID=$((SNAP_ID+1))
SNAP_PATH="${SNAP_DIR}/${NEXT_SNAP_ID}"
SNAP_PATH_SHORT="${SNAP_DIR_SHORT}/${NEXT_SNAP_ID}"

View File

@ -20,18 +20,13 @@
SRC=$1
SNAP_ID=$2
VMID=$3
DSID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
DATASTORES=/var/lib/one/datastores
else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
DATASTORES=$ONE_LOCATION/var/datastores
fi
DRIVER_PATH=$(dirname $0)
. $TMCOMMON