aboutsummaryrefslogtreecommitdiff
path: root/block/block-backend.c
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-07-05 17:15:10 +0100
committerHanna Reitz <hreitz@redhat.com>2022-07-12 12:14:56 +0200
commit3b35d4542c8537a9269f6372df531ced6c960084 (patch)
tree0a59e4957fa7193db852233956f77515e37a2c41 /block/block-backend.c
parentbf5b16fa401633475d21d69c66532f5b29e8433d (diff)
downloadqemu-3b35d4542c8537a9269f6372df531ced6c960084.zip
qemu-3b35d4542c8537a9269f6372df531ced6c960084.tar.gz
qemu-3b35d4542c8537a9269f6372df531ced6c960084.tar.bz2
block: Add a 'flags' param to blk_pread()
For consistency with other I/O functions, and in preparation to implement it using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression blk, offset, buf, bytes; @@ - blk_pread(blk, offset, buf, bytes) + blk_pread(blk, offset, buf, bytes, 0) It had no effect on hw/block/nand.c, presumably due to the #if, so that file was updated manually. Overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria <afaria@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-3-afaria@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r--block/block-backend.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index 4c5e130..bdde90d 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1563,14 +1563,15 @@ BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset,
flags | BDRV_REQ_ZERO_WRITE, cb, opaque);
}
-int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes)
+int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes,
+ BdrvRequestFlags flags)
{
int ret;
QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);
IO_OR_GS_CODE();
blk_inc_in_flight(blk);
- ret = blk_do_preadv(blk, offset, bytes, &qiov, 0);
+ ret = blk_do_preadv(blk, offset, bytes, &qiov, flags);
blk_dec_in_flight(blk);
return ret;