From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAZcN-0003oH-Jl for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAZcM-0001dN-NB for qemu-devel@nongnu.org; Wed, 08 Jun 2016 05:17:43 -0400 From: Kevin Wolf Date: Wed, 8 Jun 2016 11:16:52 +0200 Message-Id: <1465377417-5012-27-git-send-email-kwolf@redhat.com> In-Reply-To: <1465377417-5012-1-git-send-email-kwolf@redhat.com> References: <1465377417-5012-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 26/31] block: Don't emulate natively supported pwritev flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org Drivers that implement .bdrv_co_pwritev() get the flags passed as an argument to said function, but we also unconditionally emulate the flags anyway. We shouldn't do that. Fix this by clearing all flags that the driver supports natively after it returns from .bdrv_co_pwritev(). Fixes: 4df863f3 ('block: Make supported_write_flags a per-bds property') Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index 9dc265b..fb99a71 100644 --- a/block/io.c +++ b/block/io.c @@ -816,7 +816,9 @@ static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, int ret; if (drv->bdrv_co_pwritev) { - ret = drv->bdrv_co_pwritev(bs, offset, bytes, qiov, flags); + ret = drv->bdrv_co_pwritev(bs, offset, bytes, qiov, + flags & bs->supported_write_flags); + flags &= ~bs->supported_write_flags; goto emulate_flags; } -- 1.8.3.1