qemu-devel
[Top][All Lists]
Advanced

[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: Rik van Riel
Subject: Re: [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk
Date: Sat, 29 Jul 2006 10:59:43 -0400
User-agent: Thunderbird 1.5.0.4 (X11/20060614)

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...

This may look like hair splitting, but so far I've lost a
(test) postgresql database to this 3 times already.  Not getting
the guest application's data to disk when the application calls
fsync is a recipe for disaster.

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan




reply via email to

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