[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v10 2/5] aio: Another fix to the walking_handlers lo
From: |
Bharata B Rao |
Subject: |
[Qemu-devel] [PATCH v10 2/5] aio: Another fix to the walking_handlers logic |
Date: |
Thu, 27 Sep 2012 19:27:43 +0530 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
aio: Another fix to the walking_handlers logic
From: Paolo Bonzini <address@hidden>
The AIO dispatch loop will call QLIST_REMOVE and g_free even if there
are other pending calls to qemu_aio_wait outside the current one.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Bharata B Rao <address@hidden>
---
aio.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/aio.c b/aio.c
index 99b8b72..c738a4e 100644
--- a/aio.c
+++ b/aio.c
@@ -159,14 +159,14 @@ bool qemu_aio_wait(void)
/* if we have any readable fds, dispatch event */
if (ret > 0) {
- walking_handlers++;
-
/* we have to walk very carefully in case
* qemu_aio_set_fd_handler is called while we're walking */
node = QLIST_FIRST(&aio_handlers);
while (node) {
AioHandler *tmp;
+ walking_handlers++;
+
if (!node->deleted &&
FD_ISSET(node->fd, &rdfds) &&
node->io_read) {
@@ -181,13 +181,13 @@ bool qemu_aio_wait(void)
tmp = node;
node = QLIST_NEXT(node, node);
- if (tmp->deleted) {
+ walking_handlers--;
+
+ if (!walking_handlers && tmp->deleted) {
QLIST_REMOVE(tmp, node);
g_free(tmp);
}
}
-
- walking_handlers--;
}
return true;
[Qemu-devel] [PATCH v10 4/5] configure: Add a config option for GlusterFS as block backend, Bharata B Rao, 2012/09/27
[Qemu-devel] [PATCH v10 5/5] block: Support GlusterFS as a QEMU block backend., Bharata B Rao, 2012/09/27
Re: [Qemu-devel] [PATCH v10 0/5] GlusterFS support in QEMU - v10, Kevin Wolf, 2012/09/28