summary refs log tree commit diff stats
path: root/util/aio-posix.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-18 14:11:51 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-05-18 14:11:52 +0100
commitd32e41a1188e929cc0fb16829ce3736046951e39 (patch)
tree66b60cd46339a23cd8fb5cc36f52db7135b71028 /util/aio-posix.c
parentdba0f15a3b3a2e72a526be665efad73f3c34a5dd (diff)
parentcd0a6d2b2c3d5cbf82a868d8c6c80961bcda6db5 (diff)
downloadfocaccia-qemu-d32e41a1188e929cc0fb16829ce3736046951e39.tar.gz
focaccia-qemu-d32e41a1188e929cc0fb16829ce3736046951e39.zip
Merge remote-tracking branch 'remotes/famz/tags/docker-and-block-pull-request' into staging
Docker and block patches

Two fairly small fixes.

# gpg: Signature made Fri 18 May 2018 10:17:06 BST
# gpg:                using RSA key CA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@redhat.com>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/docker-and-block-pull-request:
  iothread: fix epollfd leak in the process of delIOThread
  docker: Fix trivial typo

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/aio-posix.c')
-rw-r--r--util/aio-posix.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/util/aio-posix.c b/util/aio-posix.c
index d8f0cb4af8..118bf5784b 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -45,11 +45,11 @@ struct AioHandler
 
 static void aio_epoll_disable(AioContext *ctx)
 {
-    ctx->epoll_available = false;
-    if (!ctx->epoll_enabled) {
+    ctx->epoll_enabled = false;
+    if (!ctx->epoll_available) {
         return;
     }
-    ctx->epoll_enabled = false;
+    ctx->epoll_available = false;
     close(ctx->epollfd);
 }
 
@@ -713,6 +713,13 @@ void aio_context_setup(AioContext *ctx)
 #endif
 }
 
+void aio_context_destroy(AioContext *ctx)
+{
+#ifdef CONFIG_EPOLL_CREATE1
+    aio_epoll_disable(ctx);
+#endif
+}
+
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {