Adding --output=___ to qemu-img info produces machine-readable output that is easy to parse in scripts.