]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: Fix capacity value for LUKS encrypted volumes
authorJohn Ferlan <jferlan@redhat.com>
Fri, 24 Mar 2017 13:26:17 +0000 (09:26 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 3 Apr 2017 20:15:29 +0000 (16:15 -0400)
commitb7d44f450c06803df7df3ad380f7a5c97425c1e6
tree264c74580a713742bfa524799475c3d17034d9e9
parentb202c39adc5c512037bd38c195585a1b93fe136f
storage: Fix capacity value for LUKS encrypted volumes

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

The 'capacity' value (e.g. guest logical size) for a LUKS volume is
smaller than the 'physical' value of the file in the file system, so
we need to account for that.

When peeking at the encryption information about the volume add a fetch
of the payload_offset which is described as the offset to the start of
the volume data (in 512 byte sectors) in QEMU's QCryptoBlockLUKSHeader.

Then adjust the ->capacity appropriately when we determine that the
volume target encryption has a payload_offset value.
src/storage/storage_util.c
src/util/virstorageencryption.h
src/util/virstoragefile.c