20.04.2020 16:32, Kevin Wolf wrote:
Now that block drivers can support flags for .bdrv_co_truncate, expose
the parameter in the node level interfaces bdrv_co_truncate() and
bdrv_truncate().

Signed-off-by: Kevin Wolf <kw...@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>

---

[..]

@@ -4169,7 +4170,7 @@ static int coroutine_fn 
qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
          new_file_size = allocation_start +
                          nb_new_data_clusters * s->cluster_size;
          /* Image file grows, so @exact does not matter */
-        ret = bdrv_co_truncate(bs->file, new_file_size, false, prealloc, errp);
+        ret = bdrv_co_truncate(bs->file, new_file_size, false, prealloc, 0, 
errp);

over-80 line

          if (ret < 0) {
              error_prepend(errp, "Failed to resize underlying file: ");
              qcow2_free_clusters(bs, allocation_start,
@@ -4348,7 +4349,7 @@ qcow2_co_pwritev_compressed_part(BlockDriverState *bs,
          if (len < 0) {
              return len;
          }
-        return bdrv_co_truncate(bs->file, len, false, PREALLOC_MODE_OFF, NULL);
+        return bdrv_co_truncate(bs->file, len, false, PREALLOC_MODE_OFF, 0, 
NULL);

and this one



--
Best regards,
Vladimir

Reply via email to