From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGUgT-0002U5-0E for qemu-devel@nongnu.org; Tue, 25 Sep 2012 08:56:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGUgR-0000zW-SW for qemu-devel@nongnu.org; Tue, 25 Sep 2012 08:56:16 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:47717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGUgR-0000zM-MA for qemu-devel@nongnu.org; Tue, 25 Sep 2012 08:56:15 -0400 Received: by padfb10 with SMTP id fb10so2197543pad.4 for ; Tue, 25 Sep 2012 05:56:14 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 25 Sep 2012 14:55:46 +0200 Message-Id: <1348577763-12920-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 00/17] Support for multiple "AIO contexts" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This series removes the globals from async.c/aio-posix.c so that multiple AIO contexts (mini event loops) can be added. Right now, all block devices still use qemu_bh_new, but switching them to aio_bh_new would let you associate different files with different AIO contexts. As an added bonus, integration with the glib main loop now happens via GSource. Each AIO context is a GSource, which means you can choose either to run it in its own thread (this of course needs proper locking which is not yet here), or to attach it to the main thread. In this state this is a bit of an academic exercise (though it works and may even make sense for 1.3), but I think it's an example of the tiny steps that can lead us towards an upstreamable version of the data-plane code. Paolo Paolo Bonzini (17): build: do not rely on indirect inclusion of qemu-config.h event_notifier: enable it to use pipes event_notifier: add Win32 implementation aio: change qemu_aio_set_fd_handler to return void aio: provide platform-independent API aio: introduce AioContext, move bottom halves there aio: add I/O handlers to the AioContext interface aio: add non-blocking variant of aio_wait aio: prepare for introducing GSource-based dispatch aio: add Win32 implementation aio: make AioContexts GSources aio: add aio_notify aio: call aio_notify after setting I/O handlers main-loop: use GSource to poll AIO file descriptors main-loop: use aio_notify for qemu_notify_event aio: clean up now-unused functions linux-aio: use event notifiers Makefile.objs | 6 +- aio.c => aio-posix.c | 159 +++++++++++++++------- aio.c => aio-win32.c | 190 ++++++++++++++------------ async.c | 118 ++++++++++++++--- block/Makefile.objs | 6 +- block/blkdebug.c | 1 + block/iscsi.c | 1 + event_notifier.c => event_notifier-posix.c | 83 +++++++++--- event_notifier.c => event_notifier-win32.c | 48 +++---- event_notifier.h | 20 ++- hw/hw.h | 1 + iohandler.c | 1 + linux-aio.c | 49 +++---- main-loop.c | 152 +++++++-------------- main-loop.h | 56 +------- oslib-posix.c | 31 ----- qemu-aio.h | 206 +++++++++++++++++++++++++++-- qemu-char.h | 1 + qemu-common.h | 2 +- qemu-config.h | 1 + qemu-coroutine-lock.c | 2 +- qemu-os-win32.h | 1 - 22 file modificati, 702 inserzioni(+), 433 rimozioni(-) copy aio.c => aio-posix.c (48%) rename aio.c => aio-win32.c (44%) copy event_notifier.c => event_notifier-posix.c (36%) rename event_notifier.c => event_notifier-win32.c (49%) -- 1.7.12