mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-15 17:23:10 +09:00
feature #1770: Apparent size of qcow images reported by fs_size function
This commit is contained in:
1 parent
d1b71d0df1
commit
f69e86f2bb
1 file changed
+5
-2
@@ -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")
|
||||
;;
|
||||
|
||||
Reference in new issue
Block a user