<div dir="ltr">PING</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 29, 2020 at 2:49 AM Sebastian Mitterle <<a href="mailto:smitterl@redhat.com">smitterl@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The changed condition was always false because the function was always<br>
called with boundary values 0.<br>
<br>
Use the free extent's start value to get its start offset from the<br>
cylinder boundary and determine if the needed size for allocation<br>
needs to be expanded too in case the offset doesn't fit within extra<br>
bytes for alignment.<br>
<br>
This fixes an issue where vol-create-from will call qemu-img convert<br>
to create a destination volume of same capacity as the source volume<br>
and qemu-img will error 'Cannot grow device files' due to the partition<br>
being too small for the source although both destination partition and<br>
source volume have the same capacity.<br>
<br>
Signed-off-by: Sebastian Mitterle <<a href="mailto:smitterl@redhat.com" target="_blank">smitterl@redhat.com</a>><br>
---<br>
 src/storage/storage_backend_disk.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c<br>
index a6d4e41220..ec0679d353 100644<br>
--- a/src/storage/storage_backend_disk.c<br>
+++ b/src/storage/storage_backend_disk.c<br>
@@ -691,7 +691,7 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPtr pool,<br>
          if (def->source.format == VIR_STORAGE_POOL_DISK_DOS) {<br>
              /* align to cylinder boundary */<br>
              neededSize += extraBytes;<br>
-             if ((*start % cylinderSize) > extraBytes) {<br>
+             if ((dev->freeExtents[i].start % cylinderSize) > extraBytes) {<br>
                  /* add an extra cylinder if the offset can't fit within<br>
                     the extra bytes we have */<br>
                  neededSize += cylinderSize;<br>
-- <br>
2.25.2<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Best,<div>Sebastian</div></div></div>