docs/tools/qemu-nbd.rst | 4 +- include/block/nbd.h | 3 +- include/io/channel-util.h | 23 +++++++ include/io/channel.h | 69 +++++++++----------- include/qemu/vhost-user-server.h | 1 + block/nbd.c | 11 +--- io/channel-command.c | 10 ++- io/channel-file.c | 9 ++- io/channel-null.c | 3 +- io/channel-socket.c | 9 ++- io/channel-tls.c | 6 +- io/channel-util.c | 24 +++++++ io/channel.c | 124 ++++++++++++++++++++++++++---------- migration/channel-block.c | 3 +- migration/rdma.c | 25 ++++---- nbd/client-connection.c | 3 +- nbd/client.c | 14 ++--- nbd/server.c | 14 +---- qemu-nbd.c | 133 +++++++++++++++++++++------------------ scsi/qemu-pr-helper.c | 4 +- util/iov.c | 2 +- util/vhost-user-server.c | 27 +++++--- tests/qemu-iotests/197 | 8 +-- tests/qemu-iotests/197.out | 18 +++--- 24 files changed, 328 insertions(+), 219 deletions(-)