qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] aio-posix: Don't use epoll if epoll_create1 not available
@ 2016-02-23  1:20 Fam Zheng
  2016-02-23 11:28 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Fam Zheng @ 2016-02-23  1:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Stefan Hajnoczi

Reported-by: Matthew Fortune <Matthew.Fortune@imgtec.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 aio-posix.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/aio-posix.c b/aio-posix.c
index fa7f8ab..97e5a0c 100644
--- a/aio-posix.c
+++ b/aio-posix.c
@@ -18,7 +18,9 @@
 #include "block/block.h"
 #include "qemu/queue.h"
 #include "qemu/sockets.h"
-#ifdef CONFIG_EPOLL
+
+#if defined(CONFIG_EPOLL) && defined(CONFIG_EPOLL_CREATE1)
+#define USE_EPOLL 1
 #include <sys/epoll.h>
 #endif
 
@@ -33,7 +35,7 @@ struct AioHandler
     QLIST_ENTRY(AioHandler) node;
 };
 
-#ifdef CONFIG_EPOLL
+#ifdef USE_EPOLL
 
 /* The fd number threashold to switch to epoll */
 #define EPOLL_ENABLE_THRESHOLD 64
@@ -483,7 +485,7 @@ bool aio_poll(AioContext *ctx, bool blocking)
 
 void aio_context_setup(AioContext *ctx, Error **errp)
 {
-#ifdef CONFIG_EPOLL
+#ifdef USE_EPOLL
     assert(!ctx->epollfd);
     ctx->epollfd = epoll_create1(EPOLL_CLOEXEC);
     if (ctx->epollfd == -1) {
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-23 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23  1:20 [Qemu-devel] [PATCH] aio-posix: Don't use epoll if epoll_create1 not available Fam Zheng
2016-02-23 11:28 ` Stefan Hajnoczi

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).