mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
feature #1770: Apparent size of qcow images reported by fs_size function
This commit is contained in:
parent
d1b71d0df1
commit
f69e86f2bb
@ -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")
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user