From patchwork Tue Oct 20 05:16:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 532788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 87D3A1401AF for ; Tue, 20 Oct 2015 16:24:29 +1100 (AEDT) Received: from localhost ([::1]:43809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoPPP-0000jy-55 for incoming@patchwork.ozlabs.org; Tue, 20 Oct 2015 01:24:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoPIb-0002tI-M7 for qemu-devel@nongnu.org; Tue, 20 Oct 2015 01:17:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoPIY-0005tr-Nm for qemu-devel@nongnu.org; Tue, 20 Oct 2015 01:17:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoPIT-0005mT-I6; Tue, 20 Oct 2015 01:17:17 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 1D88BC0C1895; Tue, 20 Oct 2015 05:17:17 +0000 (UTC) Received: from fam-t430.nay.redhat.com. (dhcp-14-147.nay.redhat.com [10.66.14.147]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9K5H4Rg019373; Tue, 20 Oct 2015 01:17:13 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Tue, 20 Oct 2015 13:16:53 +0800 Message-Id: <1445318223-30055-3-git-send-email-famz@redhat.com> In-Reply-To: <1445318223-30055-1-git-send-email-famz@redhat.com> References: <1445318223-30055-1-git-send-email-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org Subject: [Qemu-devel] [PATCH v4 02/12] nbd: Mark fd handlers client type as "external" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 --- 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); } }