[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk

From: Jens Axboe
Subject: Re: [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk
Date: Mon, 31 Jul 2006 09:08:44 +0200

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]