]> git.ipfire.org Git - thirdparty/qemu.git/commit
io: Add new qio_channel_read{, v}_all_eof functions
authorEric Blake <eblake@redhat.com>
Tue, 5 Sep 2017 19:11:13 +0000 (14:11 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 6 Sep 2017 15:11:54 +0000 (10:11 -0500)
commite8ffaa311080a570a7c86d03c139c160cd11a831
treedd1a6cd2859b757a20dd9248dc98ada5c3b23755
parent9ffb8270205a274a18ee4f8a735e2fccaf957246
io: Add new qio_channel_read{, v}_all_eof functions

Some callers want to distinguish between clean EOF (no bytes read)
vs. a short read (at least one byte read, but EOF encountered
before reaching the desired length), as it allows clients the
ability to do a graceful shutdown when a server shuts down at
defined safe points in the protocol, rather than treating all
shutdown scenarios as an error due to EOF.  However, we don't want
to require all callers to have to check for early EOF.  So add
another wrapper function that can be used by the callers that care
about the distinction.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170905191114.5959-3-eblake@redhat.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
include/io/channel.h
io/channel.c