qcow2: include LUKS payload overhead in qemu-img measure
commit61914f8906fabbae26372a576d9dd988c5e22b75
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 18 Feb 2019 10:45:24 +0000 (18 10:45 +0000)
committerMax Reitz <mreitz@redhat.com>
Mon, 25 Feb 2019 14:11:28 +0000 (25 15:11 +0100)
treeb820fc218ba85f7912764924cee8218e512e16e4
parent8a57a4be8389073d8bdb5d5d22e50d6282a36df0
qcow2: include LUKS payload overhead in qemu-img measure

LUKS encryption reserves clusters for its own payload data.  The size of
this area must be included in the qemu-img measure calculation so that
we arrive at the correct minimum required image size.

(Ab)use the qcrypto_block_create() API to determine the payload
overhead.  We discard the payload data that qcrypto thinks will be
written to the image.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190218104525.23674-2-stefanha@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2.c