On Thu, Oct 22, 2009 at 11:05:55AM +0200, Kevin Wolf wrote: > Yes, it might look like overkill to introduce a abstraction for exactly > two backends. I felt the same way. But then, the current implementation > just feels totally wrong. It absolutely intransparent when we fall back > to paio, and before debugging the bdrv_read/write emulation I didn't > even know that we're doing it. And, like I said, why should a block > format driver know what AIO method works which way?
Because the aio method is part of the block driver. Despite our code organization linux-aio.c and compat-posix-aio.c aren't generic abstractions but sub-modules of raw-posix. They would be better of beeing renamed to block/raw-posix-aio-linux.c and block/raw-posix-aio-pthreads.c, but with the latency of getting patches into qemu that would just make developing any block code a nightmare while those patches are in the queue.