]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: Force reading of meta data to get encryption capacity value
authorJohn Ferlan <jferlan@redhat.com>
Thu, 15 Jun 2017 18:32:43 +0000 (14:32 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 24 Jun 2017 10:43:25 +0000 (06:43 -0400)
commit5431055d2b833463b25269cdb486dd08ef790097
tree557ed14bd3414351f7c9c7585a66606a45ecb258
parentd65781bf061fb6369494b381c908ec2e08b05769
util: Force reading of meta data to get encryption capacity value

https://bugzilla.redhat.com/show_bug.cgi?id=1371892

As it turns out the volume create, build, and refresh path was not peeking
at the meta data, so immediately after a create operation the value displayed
for capacity was still incorrect. However, if a pool refresh was done the
correct value was fetched as a result of a meta data peek.

The reason is it seems historically if the file type is RAW then peeking
at the file just took the physical value for the capacity. However, since
we know if it's an encrypted file, then peeking at the meta data will be
required in order to get a true capacity value.

So check for encryption in the source and if present, use the meta data
in order to fill in the capacity value and set the payload_offset.
src/util/virstoragefile.c