On 14.06.2014 09:57, Paolo Bonzini wrote:
Il 14/06/2014 00:30, Max Reitz ha scritto:
+static void nbd_set_handlers(NBDClient *client)
+{
+if (client->exp && client->exp->ctx) {
+aio_set_fd_handler(client->exp->ctx, client->sock,
+ client->can_read ? nbd_read
Il 14/06/2014 00:30, Max Reitz ha scritto:
+static void nbd_set_handlers(NBDClient *client)
+{
+if (client->exp && client->exp->ctx) {
+aio_set_fd_handler(client->exp->ctx, client->sock,
+ client->can_read ? nbd_read : NULL,
+ client
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()