summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorAlberto Faria2022-06-09 17:27:40 +0200
committerHanna Reitz2022-07-12 12:14:56 +0200
commitc1458c66b2a56a86d4e453b52dfd2c06040fe006 (patch)
tree0d5b8715b2e0fcb3700cb97f83ddc20630e62205 /include/block
parentblock: Make bdrv_co_pwrite() take a const buffer (diff)
downloadqemu-c1458c66b2a56a86d4e453b52dfd2c06040fe006.tar.gz
qemu-c1458c66b2a56a86d4e453b52dfd2c06040fe006.tar.xz
qemu-c1458c66b2a56a86d4e453b52dfd2c06040fe006.zip
block: Make 'bytes' param of bdrv_co_{pread,pwrite,preadv,pwritev}() an int64_t
For consistency with other I/O functions, and in preparation to implement bdrv_{pread,pwrite}() using generated_co_wrapper. unsigned int fits in int64_t, so all callers remain correct. bdrv_check_request32() is called further down the stack and causes -EIO to be returned if 'bytes' is negative or greater than BDRV_REQUEST_MAX_BYTES, which in turns never exceeds SIZE_MAX. Signed-off-by: Alberto Faria <afaria@redhat.com> Message-Id: <20220609152744.3891847-7-afaria@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block_int-io.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h
index 5474293c4f..91cdd61692 100644
--- a/include/block/block_int-io.h
+++ b/include/block/block_int-io.h
@@ -56,7 +56,7 @@ int coroutine_fn bdrv_co_pwritev_part(BdrvChild *child,
QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags);
static inline int coroutine_fn bdrv_co_pread(BdrvChild *child,
- int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags)
+ int64_t offset, int64_t bytes, void *buf, BdrvRequestFlags flags)
{
QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);
IO_CODE();
@@ -65,7 +65,7 @@ static inline int coroutine_fn bdrv_co_pread(BdrvChild *child,
}
static inline int coroutine_fn bdrv_co_pwrite(BdrvChild *child,
- int64_t offset, unsigned int bytes, const void *buf, BdrvRequestFlags flags)
+ int64_t offset, int64_t bytes, const void *buf, BdrvRequestFlags flags)
{
QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);
IO_CODE();