On Fri, Apr 1, 2011 at 7:29 PM, Lyu Mitnick <mitnick....@gmail.com> wrote: > Hello > I have some question about asynchronous i/o in QEMU block driver: Why a file > format with asynchronous i/o support(ex. qcow) doesn't need to register > bdrv_read/bdrv_write which is registered in vhd file format?? Would qcow > block driver > also support synchronous i/o??
Take a look at block.c. There are synchronous I/O emulation (and asynchronous I/O emulation) functions in case the block driver provides only asynchronous (or synchronous, respectively) functions. One thing to mention about synchronous and asynchronous interfaces is that block drivers which are synchronous really don't work well for running VMs. They block execution until I/O completes (which can take a long time) and therefore steal time from the guest (i.e. laggy, poor responsiveness from the guest). Therefore synchronous block drivers are useful for qemu-img convert but not running VMs. Stefan