diff --git a/src/datastore_mad/remotes/libfs.sh b/src/datastore_mad/remotes/libfs.sh index e890d94996..373774092e 100644 --- a/src/datastore_mad/remotes/libfs.sh +++ b/src/datastore_mad/remotes/libfs.sh @@ -178,11 +178,14 @@ function fs_size { SIZE=`du -sb "$1" | cut -f1` error=$? else - TYPE=$(cat "$1" | head -n 1024 | file -b --mime-type -) + TYPE=$(cat "$1" | head -n 1024 | file -b -) case "$TYPE" in - "application/x-gzip") + *gzip*) SIZE=$(gzip_file_size "$1") ;; + *QCOW*) + SIZE=$($QEMU_IMG info "$1" | sed -n 's/.*(\([0-9]*\) bytes).*/\1/p') + ;; *) SIZE=$(file_size "$1") ;;