]> git.proxmox.com Git - mirror_qemu.git/commit
block: Add @exact parameter to bdrv_co_truncate()
authorMax Reitz <mreitz@redhat.com>
Wed, 18 Sep 2019 09:51:40 +0000 (11:51 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 11:00:07 +0000 (12:00 +0100)
commitc80d8b06cfa59f5d8229379c85dcb2c3bb9c881b
tree0e30acba1187e0e5ccfaaf6324dc46431b6691af
parent26536c7fc25917d1bd13781f81fe3ab039643bff
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>
31 files changed:
block/block-backend.c
block/commit.c
block/crypto.c
block/file-posix.c
block/file-win32.c
block/gluster.c
block/io.c
block/iscsi.c
block/mirror.c
block/nfs.c
block/parallels.c
block/qcow.c
block/qcow2-refcount.c
block/qcow2.c
block/qed.c
block/raw-format.c
block/rbd.c
block/sheepdog.c
block/ssh.c
block/vdi.c
block/vhdx-log.c
block/vhdx.c
block/vmdk.c
block/vpc.c
blockdev.c
include/block/block.h
include/block/block_int.h
include/sysemu/block-backend.h
qemu-img.c
qemu-io-cmds.c
tests/test-block-iothread.c