Received: from eggs.gnu.org ([2001:4830:134:3::10]:36906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8sVM-0007Je-9c for qemu-devel@nongnu.org; Fri, 03 Jun 2016 13:03:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8sVB-0003Vm-Gr for qemu-devel@nongnu.org; Fri, 03 Jun 2016 13:03:27 -0400 Received: from resqmta-po-11v.sys.comcast.net ([2001:558:fe16:19:96:114:154:170]:38798 helo=resqmta-ch2-11v.sys.comcast.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8sVB-0003Ua-CN for qemu-devel@nongnu.org; Fri, 03 Jun 2016 13:03:17 -0400 From: Eric Blake Date: Fri, 3 Jun 2016 11:03:05 -0600 Message-Id: <1464973388-15821-3-git-send-email-eblake@redhat.com> In-Reply-To: <1464973388-15821-1-git-send-email-eblake@redhat.com> References: <1464973388-15821-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH 2/5] block: Honor flags during bdrv_aligned_preadv() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mreitz@redhat.com, kwolf@redhat.com, qemu-block@nongnu.org, Stefan Hajnoczi , Fam Zheng Not that we pass any flags during reads yet, but we may want to support BDRV_REQ_FUA on reads in the future. So don't throw away the input flags. Signed-off-by: Eric Blake --- block/io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/io.c b/block/io.c index 81618b9..3c7b233 100644 --- a/block/io.c +++ b/block/io.c @@ -983,7 +983,7 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs, /* Forward the request to the BlockDriver */ if (!bs->zero_beyond_eof) { - ret = bdrv_driver_preadv(bs, offset, bytes, qiov, 0); + ret = bdrv_driver_preadv(bs, offset, bytes, qiov, flags); } else { /* Read zeros after EOF */ int64_t total_sectors, max_nb_sectors; @@ -997,7 +997,7 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs, max_nb_sectors = ROUND_UP(MAX(0, total_sectors - sector_num), align >> BDRV_SECTOR_BITS); if (nb_sectors < max_nb_sectors) { - ret = bdrv_driver_preadv(bs, offset, bytes, qiov, 0); + ret = bdrv_driver_preadv(bs, offset, bytes, qiov, flags); } else if (max_nb_sectors > 0) { QEMUIOVector local_qiov; @@ -1007,7 +1007,7 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs, ret = bdrv_driver_preadv(bs, offset, max_nb_sectors * BDRV_SECTOR_SIZE, - &local_qiov, 0); + &local_qiov, flags); qemu_iovec_destroy(&local_qiov); } else { -- 2.5.5