Skip to content
  • Max Reitz's avatar
    nbd: Drop nbd_can_read() · 958c717d
    Max Reitz authored
    
    
    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: default avatarMax Reitz <mreitz@redhat.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    958c717d