Skip to content

io/channel: complete pread/pwrite_all API and fix multifd_file_recv_data

Junjie Cao qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 13 repliesIn review
  2. v23 patches 5 repliesSuperseded
  3. v11 patch 2 repliesSuperseded

Changes in v3 from the cover letter

- Added qio_channel_pread_all_eof() to complete the API set (Daniel)
- Added pwrite_all / pwritev_all variants (Daniel)
- Reworked doc comments to match existing API style (Daniel)
- Added Fixes tag, expanded _eof test coverage, added CONFIG_PREADV guard

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4io/channel: introduce qio_channel_pread{v, }_all{, _eof}()include/io/channel.h io/channel.c+183 -02 replies
2/4io/channel: introduce qio_channel_pwrite{v,}_all()include/io/channel.h io/channel.c+89 -02 replies
3/4migration/file: fix type mismatch and NULL deref in multifd_file_recv_datamigration/file.c+7 -61 reply
4/4tests/unit: add pread/pwrite _all tests for io channel filetests/unit/test-io-channel-file.c+207 -02 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchDaniel P. BerrangéFabiano Rosas
1/4R-b A-b R-b
2/4R-b A-b R-b
3/4R-b R-b
4/4R-b A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] io/channel: complete pread/pwrite_all API and fix multifd_file_recv_data

This series fixes two bugs in multifd_file_recv_data() and completes the positioned read/write "all" API set for QIO channels.

Bug summary:
- size_t variable storing ssize_t return: -1 wraps to SIZE_MAX
- error_prepend() called without ERRP_GUARD(): NULL deref on short read

Changes since v2:
- Added qio_channel_pread_all_eof() to complete the API set (Daniel)
- Added pwrite_all / pwritev_all variants (Daniel)
- Reworked doc comments to match existing API style (Daniel)
- Added Fixes tag, expanded _eof test coverage, added CONFIG_PREADV guard

Changes since v1:
- Used approach (b): add pread_all API instead of local retry loop (Daniel, Peter)

v2: https://lore.kernel.org/qemu-devel/[email protected]/
v1: https://lore.kernel.org/qemu-devel/[email protected]/

Junjie Cao (4):
io/channel: introduce qio_channel_pread{v,}_all{,_eof}() io/channel: introduce qio_channel_pwrite{v,}_all() migration/file: fix type mismatch and NULL deref in
multifd_file_recv_data
tests/unit: add pread/pwrite _all tests for io channel file

 include/io/channel.h              | 133 +++++++++++++++++++
 io/channel.c                      | 139 ++++++++++++++++++++
 migration/file.c                  |  13 +-
 tests/unit/test-io-channel-file.c | 207 ++++++++++++++++++++++++++++++
 4 files changed, 486 insertions(+), 6 deletions(-)
Signature · 1 line
2.43.0