On Wed, Mar 30, 2011 at 08:08:34PM -0500, Anthony Liguori wrote: > When creating an image using qemu-img, just pass '-o copy_on_read' and then > whenever QED reads from a backing file, it will write the block to the QED > file after the read completes ensuring that you only fetch from the backing > device once. > > This is very useful for streaming images over a slow connection. > > This isn't ready for merge yet as it's not playing nice with synchronize I/O.
What is the issue here? Streaming had issues with aio contexts and synchronous I/O emulation but copy-on-read by itself looks safe to me. > I think it's fairly easy to do the same thing in qcow2 by just hooking adding > some logic after bdrv_aio_write() to call back into qcow2 with a synchronous > I/O write in the backing file case. Thoughts on whether that would actually > work? Why not do the follow-up .bdrv_aio_writev() for qcow2 too? I don't see a reason to do it synchronously. Stefan