qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com,
	qemu-block@nongnu.org
Subject: [Qemu-devel] [RFC PATCH 06/11] nbd: Mark fd handlers client type as "nbd server"
Date: Thu, 23 Jul 2015 14:32:13 +0800	[thread overview]
Message-ID: <1437633138-29188-7-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1437633138-29188-1-git-send-email-famz@redhat.com>

So we could distinguish it from "protocol" to avoid handling in nested aio
polls.

Signed-off-by: Fam Zheng <famz@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

  parent reply	other threads:[~2015-07-23  8:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23  6:32 [Qemu-devel] [RFC PATCH 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 01/11] aio: Introduce "type" in aio_set_fd_handler and aio_set_event_notifier Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 02/11] aio: Save type to AioHandler Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 03/11] aio-posix: Introduce aio_poll_clients Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 04/11] aio-win32: Implement aio_poll_clients Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 05/11] block: Mark fd handlers as "protocol" Fam Zheng
2015-07-23  6:32 ` Fam Zheng [this message]
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 07/11] aio: Mark ctx->notifier's client type as "context" Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 08/11] dataplane: Mark host notifiers' client type as "dataplane" Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 09/11] block: Introduce bdrv_aio_poll Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 10/11] block: Replace nested aio_poll with bdrv_aio_poll Fam Zheng
2015-07-23  6:32 ` [Qemu-devel] [RFC PATCH 11/11] block: Only poll block layer fds in bdrv_aio_poll Fam Zheng
2015-07-23  8:15 ` [Qemu-devel] [RFC PATCH 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane Paolo Bonzini
2015-07-23 11:43   ` Fam Zheng
2015-07-24  7:35     ` Paolo Bonzini
2015-07-27  6:55       ` Fam Zheng
2015-07-27 13:23         ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437633138-29188-7-git-send-email-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).