Re: [Qemu-devel] [PATCH 1/3] nbd: Drop nbd_can_read()

2014-06-14 Thread Max Reitz
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

Re: [Qemu-devel] [PATCH 1/3] nbd: Drop nbd_can_read()

2014-06-14 Thread Paolo Bonzini
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

[Qemu-devel] [PATCH 1/3] nbd: Drop nbd_can_read()

2014-06-13 Thread Max Reitz
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()