[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/30] aio: Fix qemu_aio_wait() to maintain correct
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 03/30] aio: Fix qemu_aio_wait() to maintain correct walking_handlers count |
Date: |
Fri, 28 Sep 2012 19:56:46 +0200 |
From: Paolo Bonzini <address@hidden>
Fix qemu_aio_wait() to ensure that registered aio handlers don't get
deleted when they are still active. This is ensured by maintaning the
right count of walking_handlers.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Bharata B Rao <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
aio.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/aio.c b/aio.c
index 0a9eb10..99b8b72 100644
--- a/aio.c
+++ b/aio.c
@@ -119,7 +119,7 @@ bool qemu_aio_wait(void)
return true;
}
- walking_handlers = 1;
+ walking_handlers++;
FD_ZERO(&rdfds);
FD_ZERO(&wrfds);
@@ -147,7 +147,7 @@ bool qemu_aio_wait(void)
}
}
- walking_handlers = 0;
+ walking_handlers--;
/* No AIO operations? Get us out of here */
if (!busy) {
@@ -159,7 +159,7 @@ bool qemu_aio_wait(void)
/* if we have any readable fds, dispatch event */
if (ret > 0) {
- walking_handlers = 1;
+ walking_handlers++;
/* we have to walk very carefully in case
* qemu_aio_set_fd_handler is called while we're walking */
@@ -187,7 +187,7 @@ bool qemu_aio_wait(void)
}
}
- walking_handlers = 0;
+ walking_handlers--;
}
return true;
--
1.7.6.5
- [Qemu-devel] [PULL 00/30] Block patches, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 02/30] block: after creating a live snapshot, make old image read-only, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 01/30] block-migration: Flush requests in blk_mig_cleanup, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 03/30] aio: Fix qemu_aio_wait() to maintain correct walking_handlers count,
Kevin Wolf <=
- [Qemu-devel] [PATCH 06/30] configure: Add a config option for GlusterFS as block backend, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 07/30] block: Support GlusterFS as a QEMU block backend., Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 05/30] aio: Another fix to the walking_handlers logic, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 10/30] blockdev: rename block_stream_cb to a generic block_job_cb, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 09/30] block: add live block commit functionality, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 11/30] block: helper function, to find the base image of a chain, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 08/30] block: add support functions for live commit, to find and delete images., Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 04/30] qemu: URI parsing library, Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 12/30] QAPI: add command for live block commit, 'block-commit', Kevin Wolf, 2012/09/28
- [Qemu-devel] [PATCH 13/30] qemu-iotests: add initial tests for live block commit, Kevin Wolf, 2012/09/28