aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2017-06-13 22:20:54 +0200
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:45:01 +0200
commit3a691c50f10344b052ad70a4d0ed935276ccca3c (patch)
tree7987afc8abe63f577c59a11e698ea4536cf2c0d5 /block/vmdk.c
parent7ea37c30660d4cd6aca21a324fabefe23b89f931 (diff)
block: Add PreallocMode to blk_truncate()
blk_truncate() itself will pass that value to bdrv_truncate(), and all callers of blk_truncate() just set the parameter to PREALLOC_MODE_OFF for now. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170613202107.10125-4-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 55581b03fe..24d71b5982 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1714,7 +1714,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
blk_set_allow_write_beyond_eof(blk, true);
if (flat) {
- ret = blk_truncate(blk, filesize, errp);
+ ret = blk_truncate(blk, filesize, PREALLOC_MODE_OFF, errp);
goto exit;
}
magic = cpu_to_be32(VMDK4_MAGIC);
@@ -1777,7 +1777,8 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
goto exit;
}
- ret = blk_truncate(blk, le64_to_cpu(header.grain_offset) << 9, errp);
+ ret = blk_truncate(blk, le64_to_cpu(header.grain_offset) << 9,
+ PREALLOC_MODE_OFF, errp);
if (ret < 0) {
goto exit;
}
@@ -2086,7 +2087,7 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp)
/* bdrv_pwrite write padding zeros to align to sector, we don't need that
* for description file */
if (desc_offset == 0) {
- ret = blk_truncate(new_blk, desc_len, errp);
+ ret = blk_truncate(new_blk, desc_len, PREALLOC_MODE_OFF, errp);
}
exit:
if (new_blk) {