diff --git a/src/datastore_mad/remotes/downloader.sh b/src/datastore_mad/remotes/downloader.sh index 66daf438fa..dcdee6ac79 100755 --- a/src/datastore_mad/remotes/downloader.sh +++ b/src/datastore_mad/remotes/downloader.sh @@ -224,7 +224,7 @@ function get_rbd_cmd echo "ssh '$(esc_sq "$DST_HOST")' \"$RBD export '$(esc_sq "$SOURCE")' -\"" } -TEMP=`getopt -o m:s:l:c:n -l md5:,sha1:,limit:,max-size:,convert:,nodecom -- "$@"` +TEMP=`getopt -o m:s:l:c:n -l md5:,sha1:,limit:,max-size:,nodecomp -- "$@"` if [ $? != 0 ] ; then echo "Arguments error" >&2 @@ -257,10 +257,6 @@ while true; do export MAX_SIZE="$2" shift 2 ;; - --convert) - export CONVERT="$2" - shift 2 - ;; --) shift break @@ -397,44 +393,3 @@ fi if [ "$TO" != "-" ]; then unarchive "$TO" fi - -# Function to know what is the original image type -# Figure out what type of image it is -function get_original_type -{ - command_get_type="qemu-img info "$TO"" - output_get_type=$(eval "$command_get_type") - - split=$(echo $output_get_type | tr ":" "\n") - count=0 - format="" - - for pal in $split - do - if [ "$count" == 4 ]; then - format=$pal - break - fi - count=$((count+1)) - done - echo $format -} - -# Convert the image to a given type into a tmp image with qemu-img -if [ ! -z "$CONVERT" ]; then - - tmpimage=$TO".tmp" - - original_type=$(get_original_type) - convert_type=$CONVERT - - # if the type of the image differs from the target type we need to convert the image - if [ "$original_type" != "$convert_type" ]; then - convert="qemu-img convert -f "$original_type" -O "$convert_type" "$TO" "$tmpimage"" - eval "$convert" - - # Move tmp image to get the final image - mvcommand="mv "$tmpimage" "$TO"" - eval "$mvcommand" - fi -fi diff --git a/src/datastore_mad/remotes/vcenter/cp b/src/datastore_mad/remotes/vcenter/cp index 9575bb93ec..94c14ec7cc 100755 --- a/src/datastore_mad/remotes/vcenter/cp +++ b/src/datastore_mad/remotes/vcenter/cp @@ -92,7 +92,6 @@ if VCenterDriver::FileHelper.is_remote_or_needs_unpack?(img_path) downsh_args << "--sha1 #{sha1} " if sha1 && !sha1.empty? downsh_args << "--nodecomp " if nodecomp && !nodecomp.empty? downsh_args << "--limit #{limit_bw} " if limit_bw && !limit_bw.empty? - downsh_args << "--convert vmdk" downloader = "#{File.dirname(__FILE__)}/../downloader.sh #{downsh_args}"