summaryrefslogtreecommitdiffstats
path: root/qemu-io-cmds.c
diff options
context:
space:
mode:
authorMax Reitz2019-09-18 11:51:40 +0200
committerMax Reitz2019-10-28 12:00:07 +0100
commitc80d8b06cfa59f5d8229379c85dcb2c3bb9c881b (patch)
tree0e30acba1187e0e5ccfaaf6324dc46431b6691af /qemu-io-cmds.c
parentblock: Do not truncate file node when formatting (diff)
downloadqemu-c80d8b06cfa59f5d8229379c85dcb2c3bb9c881b.tar.gz
qemu-c80d8b06cfa59f5d8229379c85dcb2c3bb9c881b.tar.xz
qemu-c80d8b06cfa59f5d8229379c85dcb2c3bb9c881b.zip
block: Add @exact parameter to bdrv_co_truncate()
We have two drivers (iscsi and file-posix) that (in some cases) return success from their .bdrv_co_truncate() implementation if the block device is larger than the requested offset, but cannot be shrunk. Some callers do not want that behavior, so this patch adds a new parameter that they can use to turn off that behavior. This patch just adds the parameter and lets the block/io.c and block/block-backend.c functions pass it around. All other callers always pass false and none of the implementations evaluate it, so that this patch does not change existing behavior. Future patches take care of that. Suggested-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190918095144.955-5-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-io-cmds.c')
-rw-r--r--qemu-io-cmds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 349256a5fe..5e9017c979 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1710,7 +1710,7 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv)
return offset;
}
- ret = blk_truncate(blk, offset, PREALLOC_MODE_OFF, &local_err);
+ ret = blk_truncate(blk, offset, false, PREALLOC_MODE_OFF, &local_err);
if (ret < 0) {
error_report_err(local_err);
return ret;