From: Fam Zheng Date: Fri, 23 Oct 2015 03:08:06 +0000 (+0800) Subject: nbd: Mark fd handlers client type as "external" X-Git-Tag: v2.5.0-rc0~49^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=172cc129a5ae58d36feb51f97fd67e2161ae5cc6;p=thirdparty%2Fqemu.git 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 Reviewed-by: Jeff Cody Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- diff --git a/nbd.c b/nbd.c index 7eb6f3fd61f..b3d9654499c 100644 --- a/nbd.c +++ b/nbd.c @@ -1446,7 +1446,7 @@ static void nbd_set_handlers(NBDClient *client) { if (client->exp && client->exp->ctx) { aio_set_fd_handler(client->exp->ctx, client->sock, - false, + true, client->can_read ? nbd_read : NULL, client->send_coroutine ? nbd_restart_write : NULL, client); @@ -1457,7 +1457,7 @@ static void nbd_unset_handlers(NBDClient *client) { if (client->exp && client->exp->ctx) { aio_set_fd_handler(client->exp->ctx, client->sock, - false, NULL, NULL, NULL); + true, NULL, NULL, NULL); } }