]> git.ipfire.org Git - thirdparty/libvirt.git/commit
disk storage: fix allocation size for pool format dos
authorSebastian Mitterle <smitterl@redhat.com>
Sat, 29 Aug 2020 00:49:07 +0000 (00:49 +0000)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Sep 2020 14:53:40 +0000 (16:53 +0200)
commit653fdf48e352814efdbff72aa5421f65385088ac
treeefebb0bbee21c613c3ffab9733209beb15beb2a0
parentd3ac12e3a1c01d1205b4db3f6cd640f3da98579b
disk storage: fix allocation size for pool format dos

The changed condition was always false because the function was always
called with boundary values 0.

Use the free extent's start value to get its start offset from the
cylinder boundary and determine if the needed size for allocation
needs to be expanded too in case the offset doesn't fit within extra
bytes for alignment.

This fixes an issue where vol-create-from will call qemu-img convert
to create a destination volume of same capacity as the source volume
and qemu-img will error 'Cannot grow device files' due to the partition
being too small for the source although both destination partition and
source volume have the same capacity.

Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_backend_disk.c