summaryrefslogtreecommitdiffstats
path: root/tests/test-thread-pool.c
Commit message (Collapse)AuthorAgeFilesLines
* aio / timers: Add QEMUTimerListGroup to AioContextAlex Bligh2013-08-221-0/+3
| | | | | | | | | Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerList associated with each clock is added) and delete it when the AioContext is freed. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* tests: adjust test-thread-pool to new aio_poll() semanticsStefan Hajnoczi2013-08-191-12/+12
| | | | | | | | | | aio_poll(ctx, true) will soon block when fd handlers have been set. Previously aio_poll() would return early if all .io_flush() returned false. This means we need to check the equivalent of the .io_flush() condition *before* calling aio_poll(ctx, true) to avoid deadlock. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* add a header file for atomic operationsPaolo Bonzini2013-07-041-4/+4
| | | | | | | | We're already using them in several places, but __sync builtins are just too ugly to type, and do not provide seqcst load/store operations. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* threadpool: drop global thread poolStefan Hajnoczi2013-03-151-23/+21
| | | | | | | | | | | | | | | | | | Now that each AioContext has a ThreadPool and the main loop AioContext can be fetched with bdrv_get_aio_context(), we can eliminate the concept of a global thread pool from thread-pool.c. The submit functions must take a ThreadPool* argument. block/raw-posix.c and block/raw-win32.c use aio_get_thread_pool(bdrv_get_aio_context(bs)) to fetch the main loop's ThreadPool. tests/test-thread-pool.c must be updated to reflect the new thread_pool_submit() function prototypes. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* block: move include files to include/block/Paolo Bonzini2012-12-191-3/+3
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* tests: avoid qemu_aio_flush() in test-thread-pool.cStefan Hajnoczi2012-12-111-6/+14
| | | | | | | | | | | | | We need to eliminate calls to qemu_aio_flush() since the function is being removed. Most callers will use bdrv_drain_all() instead but test-thread-pool.c is lower level. Since the test uses the global AioContext we can loop on qemu_aio_wait() to wait for aio and bh activity to complete. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: make threadpool cancellation test looserPaolo Bonzini2012-11-271-2/+5
| | | | | | | | | | | The cancellation test is failing on the buildbots. While the failure merits a little more investigation to understand what is going on, the logs show that the failure is not impacting the coverage provided by the test. Hence, loosen a bit the assertions in a way that should let the test proceed and hopefully pass. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* tests: add thread pool unit testsPaolo Bonzini2012-11-261-0/+213
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud