nbd: Mark fd handlers client type as "external"
So we could distinguish it from internal used fds, thus avoid handling unwanted events in nested aio polls. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
dca21ef23b
commit
172cc129a5
4
nbd.c
4
nbd.c
|
@ -1446,7 +1446,7 @@ static void nbd_set_handlers(NBDClient *client)
|
||||||
{
|
{
|
||||||
if (client->exp && client->exp->ctx) {
|
if (client->exp && client->exp->ctx) {
|
||||||
aio_set_fd_handler(client->exp->ctx, client->sock,
|
aio_set_fd_handler(client->exp->ctx, client->sock,
|
||||||
false,
|
true,
|
||||||
client->can_read ? nbd_read : NULL,
|
client->can_read ? nbd_read : NULL,
|
||||||
client->send_coroutine ? nbd_restart_write : NULL,
|
client->send_coroutine ? nbd_restart_write : NULL,
|
||||||
client);
|
client);
|
||||||
|
@ -1457,7 +1457,7 @@ static void nbd_unset_handlers(NBDClient *client)
|
||||||
{
|
{
|
||||||
if (client->exp && client->exp->ctx) {
|
if (client->exp && client->exp->ctx) {
|
||||||
aio_set_fd_handler(client->exp->ctx, client->sock,
|
aio_set_fd_handler(client->exp->ctx, client->sock,
|
||||||
false, NULL, NULL, NULL);
|
true, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue