1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-25 23:21:29 +03:00

bug #867: Postpone qcow2 management to integrate it with quota system

This commit is contained in:
Ruben S. Montero 2011-10-20 11:21:38 +02:00
parent cee35c0750
commit d690e728d0

View File

@ -41,15 +41,13 @@ echo "$IMAGE_REPOSITORY_PATH/`echo $CANONICAL_MD5 | cut -d ' ' -f1`"
}
function fs_du {
QEMU_IMG=`command -v qemu-img`
SIZE=`$(stat -c %s $1)`
if [ $? = 0 ]; then
SIZE=$($QEMU_IMG info $1|awk '/^virtual size:/{print substr($4,2)}')
else
SIZE=$(stat -c %s $1)
fi
if [ $? -ne 0 ]; then
SIZE=0
else
SIZE=$(($SIZE/1048576))
fi
SIZE=$(($SIZE/1048576))
echo "$SIZE"
echo "$SIZE"
}