xemu/nbd
Paolo Bonzini a12a712a7d nbd-client: fix handling of hungup connections
After the switch to reading replies in a coroutine, nothing is
reentering pending receive coroutines if the connection hangs.
Move nbd_recv_coroutines_enter_all to the reply read coroutine,
which is the place where hangups are detected.  nbd_teardown_connection
can simply wait for the reply read coroutine to detect the hangup
and clean up after itself.

This wouldn't be enough though because nbd_receive_reply returns 0
(rather than -EPIPE or similar) when reading from a hung connection.
Fix the return value check in nbd_read_reply_entry.

This fixes qemu-iotests 083.

Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20170314111157.14464-1-pbonzini@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-03-27 16:50:36 +02:00
..
client.c nbd-client: fix handling of hungup connections 2017-03-27 16:50:36 +02:00
common.c nbd: convert to use qio_channel_yield 2017-02-21 11:14:08 +00:00
Makefile.objs
nbd-internal.h io: change the QIOTask callback signature 2017-01-23 15:32:18 +00:00
server.c nbd/server: Use real permissions for NBD exports 2017-02-28 20:47:50 +01:00