From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f87TI-0007dF-Ts for qemu-devel@nongnu.org; Mon, 16 Apr 2018 12:59:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f87TI-0003N1-4x for qemu-devel@nongnu.org; Mon, 16 Apr 2018 12:59:17 -0400 From: Max Reitz Date: Mon, 16 Apr 2018 18:58:44 +0200 Message-Id: <20180416165849.28864-5-mreitz@redhat.com> In-Reply-To: <20180416165849.28864-1-mreitz@redhat.com> References: <20180416165849.28864-1-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 4/9] block: Set BDRV_REQ_WRITE_UNCHANGED for COR writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Kevin Wolf , Stefan Hajnoczi , Fam Zheng Signed-off-by: Max Reitz --- block/io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index 134b2a498f..fada4efbf3 100644 --- a/block/io.c +++ b/block/io.c @@ -1115,13 +1115,15 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BdrvChild *child, /* FIXME: Should we (perhaps conditionally) be setting * BDRV_REQ_MAY_UNMAP, if it will allow for a sparser copy * that still correctly reads as zero? */ - ret = bdrv_co_do_pwrite_zeroes(bs, cluster_offset, pnum, 0); + ret = bdrv_co_do_pwrite_zeroes(bs, cluster_offset, pnum, + BDRV_REQ_WRITE_UNCHANGED); } else { /* This does not change the data on the disk, it is not * necessary to flush even in cache=writethrough mode. */ ret = bdrv_driver_pwritev(bs, cluster_offset, pnum, - &local_qiov, 0); + &local_qiov, + BDRV_REQ_WRITE_UNCHANGED); } if (ret < 0) { -- 2.14.3