So we could distinguish it from "protocol" to avoid handling in nested aio polls.
Signed-off-by: Fam Zheng <f...@redhat.com> --- include/block/aio.h | 1 + nbd.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/block/aio.h b/include/block/aio.h index 1895a74..088f9ce 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -274,6 +274,7 @@ bool aio_dispatch(AioContext *ctx); #define AIO_CLIENT_UNSPECIFIED (1 << 0) #define AIO_CLIENT_PROTOCOL (1 << 1) +#define AIO_CLIENT_NBD_SERVER (1 << 2) #define AIO_CLIENT_MASK_ALL -1 /* Progress in completing AIO work to occur. This can issue new pending diff --git a/nbd.c b/nbd.c index 64ed91b..7b38334 100644 --- a/nbd.c +++ b/nbd.c @@ -1437,7 +1437,7 @@ static void nbd_set_handlers(NBDClient *client) { if (client->exp && client->exp->ctx) { aio_set_fd_handler(client->exp->ctx, client->sock, - AIO_CLIENT_UNSPECIFIED, + AIO_CLIENT_NBD_SERVER, client->can_read ? nbd_read : NULL, client->send_coroutine ? nbd_restart_write : NULL, client); @@ -1448,7 +1448,7 @@ static void nbd_unset_handlers(NBDClient *client) { if (client->exp && client->exp->ctx) { aio_set_fd_handler(client->exp->ctx, client->sock, - AIO_CLIENT_UNSPECIFIED, NULL, NULL, NULL); + AIO_CLIENT_NBD_SERVER, NULL, NULL, NULL); } } -- 2.4.3