On Sat, Jul 29 2006, Rik van Riel wrote: > Fabrice Bellard wrote: > >Hi, > > > >Using O_SYNC for disk image access is not acceptable: QEMU relies on the > >host OS to ensure that the data is written correctly. > > This means that write ordering is not preserved, and on a power > failure any data written by qemu (or Xen fully virt) guests may > not be preserved. > > Applications running on the host can count on fsync doing the > right thing, meaning that if they call fsync, the data *will* > have made it to disk. Applications running inside a guest have > no guarantees that their data is actually going to make it > anywhere when fsync returns...
Then the guest OS is broken. Applications issuing an fsync() should issue a flush (or write-through), the guest OS should propagate this knowledge through it's io stack and the QEMU hard drive should get notified. If the guest OS isn't doing what it's supposed to, QEMU can't help you. And, in fact, running your app on the same host OS with write back caching would screw you as well. The timing window will probably be larger with QEMU, but the problem is essentially the same. -- Jens Axboe _______________________________________________ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel