diff mbox series

[05/18] block: Make blk_co_pwrite() take a const buffer

Message ID 20220517113837.199696-1-afaria@redhat.com
State New
Headers show
Series Make block-backend-io.h API more consistent | expand

Commit Message

Alberto Faria May 17, 2022, 11:38 a.m. UTC
It does not mutate the buffer.

Signed-off-by: Alberto Faria <afaria@redhat.com>
---
 include/sysemu/block-backend-io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini May 17, 2022, 2:20 p.m. UTC | #1
On 5/17/22 13:38, Alberto Faria wrote:
> It does not mutate the buffer.
> 
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
>   include/sysemu/block-backend-io.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> diff --git a/include/sysemu/block-backend-io.h b/include/sysemu/block-backend-io.h
> index 6630316795..6440e92028 100644
> --- a/include/sysemu/block-backend-io.h
> +++ b/include/sysemu/block-backend-io.h
> @@ -130,7 +130,7 @@ static inline int coroutine_fn blk_co_pread(BlockBackend *blk, int64_t offset,
>   }
>   
>   static inline int coroutine_fn blk_co_pwrite(BlockBackend *blk, int64_t offset,
> -                                             int64_t bytes, void *buf,
> +                                             int64_t bytes, const void *buf,
>                                                BdrvRequestFlags flags)
>   {
>       QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);
Hanna Czenczek July 4, 2022, 3:25 p.m. UTC | #2
On 17.05.22 13:38, Alberto Faria wrote:
> It does not mutate the buffer.
>
> Signed-off-by: Alberto Faria <afaria@redhat.com>
> ---
>   include/sysemu/block-backend-io.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Hanna Reitz <hreitz@redhat.com>
diff mbox series

Patch

diff --git a/include/sysemu/block-backend-io.h b/include/sysemu/block-backend-io.h
index 6630316795..6440e92028 100644
--- a/include/sysemu/block-backend-io.h
+++ b/include/sysemu/block-backend-io.h
@@ -130,7 +130,7 @@  static inline int coroutine_fn blk_co_pread(BlockBackend *blk, int64_t offset,
 }
 
 static inline int coroutine_fn blk_co_pwrite(BlockBackend *blk, int64_t offset,
-                                             int64_t bytes, void *buf,
+                                             int64_t bytes, const void *buf,
                                              BdrvRequestFlags flags)
 {
     QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);