From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp9RC-000164-Gs for qemu-devel@nongnu.org; Thu, 22 Oct 2015 02:33:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zp9RB-0008Cp-LM for qemu-devel@nongnu.org; Thu, 22 Oct 2015 02:33:22 -0400 From: Fam Zheng Date: Thu, 22 Oct 2015 14:32:50 +0800 Message-Id: <1445495580-32129-3-git-send-email-famz@redhat.com> In-Reply-To: <1445495580-32129-1-git-send-email-famz@redhat.com> References: <1445495580-32129-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v6 02/12] nbd: Mark fd handlers client type as "external" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, jcody@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org 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 --- nbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd.c b/nbd.c index fbc66be..dab1ebb 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); } } -- 2.4.3