nbd: Drop nbd_can_read()
commit958c717df97ea9ca47a2253b8371130fe5f22980
authorMax Reitz <mreitz@redhat.com>
Fri, 20 Jun 2014 19:57:32 +0000 (20 21:57 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 29 Aug 2014 09:48:45 +0000 (29 10:48 +0100)
tree35de5d72b69d06ac5c196e0ff8442f55d2cee78a
parenta780dea0454d2820e31407c33f167acf00fe447d
nbd: Drop nbd_can_read()

There is no variant of aio_set_fd_handler() like qemu_set_fd_handler2(),
so we cannot give a can_read() callback function. Instead, unregister
the nbd_read() function whenever we cannot read and re-register it as
soon as we can read again.

All this is hidden behind the functions nbd_set_handlers() (which
registers all handlers for the AIO context and file descriptor belonging
to the given client), nbd_unset_handlers() (which unregisters them) and
nbd_update_can_read() (which checks whether NBD can read for the given
client and acts accordingly).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
nbd.c