1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-21 13:57:56 +03:00

B #-: Fix output parsing of new qemu-img (#2605)

Although `qemu-io -c length $img` would be
better we would need to recalc back to bytes.
This commit is contained in:
Jan Orel 2023-05-12 13:50:36 +02:00 committed by GitHub
parent a7357a0040
commit 8b7d7029db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ function image_format {
# @return string representation of the format, empty if error
#-------------------------------------------------------------------------------
function image_vsize {
echo "$($QEMU_IMG info "${1}" 2>/dev/null | sed -n 's/.*(\([0-9]*\) bytes).*/\1/p')"
echo "$($QEMU_IMG info --output json "${1}" | jq '."virtual-size"')"
}
#-------------------------------------------------------------------------------