block-backend: update blk_co_pwrite() and blk_co_pread() wrappers
commitbec4042baefc1bfeae05b161aa17d2f57d526b60
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 7 Oct 2021 17:52:43 +0000 (7 19:52 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 15 Oct 2021 21:02:09 +0000 (15 16:02 -0500)
tree703bd3d2c17a33f362f7d54c07cb7be47426202a
parent57768ec166493260494b76a2fa9fea980ca30e18
block-backend: update blk_co_pwrite() and blk_co_pread() wrappers

Make bytes argument int64_t to be consistent with modern block-layer.
Callers should be OK with it as type becomes wider.

What is inside functions?

- Conversion from int64_t to size_t. Still, we
can't have a buffer larger than SIZE_MAX, therefore bytes should not be
larger than SIZE_MAX as well. Add an assertion.

- Passing to blk_co_pwritev() / blk_co_preadv() which already has
  int64_t bytes argument.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211007175243.642516-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: spelling fix]
Signed-off-by: Eric Blake <eblake@redhat.com>
include/sysemu/block-backend.h