On 09/27/2011 10:28 AM, Jan Kiszka wrote: > On 2011-09-27 17:17, Stefan Hajnoczi wrote: >> On Tue, Sep 27, 2011 at 3:26 PM, Avi Kivity wrote: >>> Has no business in hw/. >>> >>> Signed-off-by: Avi Kivity >>> --- >>> hw/event_notifier.c => event_notifier.c | 1 - >>> hw/event_notifier.h => event_notifier.h | 0 >>> 2 files changed, 0 insertions(+), 1 deletions(-) >>> rename hw/event_notifier.c => event_notifier.c (98%) >>> rename hw/event_notifier.h => event_notifier.h (100%) >> >> Yay. Now perhaps we can kill qemu_eventfd(), whose users are >> typically poking around with write(2) and read(2) when really they >> could use the high-level event_notifier.h API. > > EventNotifiers will have to be superseded by something more generic > first. It's not fully covering the use cases of cpus.c and > posix-aio-compat.c. Actually, for posix-aio, we can just switch to using g_idle_add(). g_idle_add() uses g_source_attach which is thread safe. g_idle_add() gives you a thread safe mechanism to defer a piece of work to the main loop which is really what we want here. This can actually be made to work with sync I/O emulation too by having another GMainLoop in the sync I/O loop although I thought I recalled a patch series to remove that stuff. Kevin/Stefan, what's the plans for sync I/O emulation? See untested patch below. Regards, Anthony Liguori > > Jan >