[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/12] nbd: Mark fd handlers client type as "externa
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH 03/12] nbd: Mark fd handlers client type as "external" |
Date: |
Fri, 9 Oct 2015 13:45:17 +0800 |
So we could distinguish it from internal used fds, thus avoid handling
unwanted events in nested aio polls.
Signed-off-by: Fam Zheng <address@hidden>
---
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 830a0e8..60e796b 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -276,6 +276,7 @@ bool aio_pending(AioContext *ctx);
bool aio_dispatch(AioContext *ctx);
#define AIO_CLIENT_UNSPECIFIED (1 << 0)
+#define AIO_CLIENT_EXTERNAL (1 << 1)
#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 16a4087..96fcc98 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,
- AIO_CLIENT_UNSPECIFIED,
+ AIO_CLIENT_EXTERNAL,
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,
- AIO_CLIENT_UNSPECIFIED, NULL, NULL, NULL);
+ AIO_CLIENT_EXTERNAL, NULL, NULL, NULL);
}
}
--
2.5.3
- [Qemu-devel] [PATCH 00/12] block: bdrv_drained_begin/end for transactions on dataplane devices, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 02/12] aio: Save fd client type to AioHandler, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 03/12] nbd: Mark fd handlers client type as "external",
Fam Zheng <=
- [Qemu-devel] [PATCH 07/12] block: Add "drained begin/end" for transactional external snapshot, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 10/12] block: Add "drained begin/end" for internal snapshot, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 11/12] block: Introduce BlockDriver.bdrv_drain callback, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 08/12] block: Add "drained begin/end" for transactional backup, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 06/12] block: Introduce "drained begin/end" API, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 01/12] aio: Introduce "type" in aio_set_fd_handler and aio_set_event_notifier, Fam Zheng, 2015/10/09
- [Qemu-devel] [PATCH 05/12] aio: introduce aio_{disable, enable}_clients, Fam Zheng, 2015/10/09