From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G6rJ6-0007HS-QN for qemu-devel@nongnu.org; Sat, 29 Jul 2006 12:04:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G6rJ4-0007EK-PT for qemu-devel@nongnu.org; Sat, 29 Jul 2006 12:04:52 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G6rJ4-0007Dh-71 for qemu-devel@nongnu.org; Sat, 29 Jul 2006 12:04:50 -0400 Received: from [65.74.133.4] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1G6rLJ-00071B-0I for qemu-devel@nongnu.org; Sat, 29 Jul 2006 12:07:09 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk Date: Sat, 29 Jul 2006 17:04:44 +0100 References: <44CA6B76.7000004@redhat.com> <44CB310B.9060308@bellard.org> <44CB77DF.9030700@redhat.com> In-Reply-To: <44CB77DF.9030700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607291704.45217.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Saturday 29 July 2006 15:59, 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. I might be willing to accept this (or similar) patch if you made it conditional on the guest having disabled write caching. I agree with Fabrice that the performance impact it too severe to consider turning it on by default. The same problems occurs with many hardware RAID controllers, and even many harddrives: fsync() only guarantees that the data has been passed to the controller (in this case the host OS). If you need absolute reliability you either need more flusing in your guest OS, disable the write cache, or battery backup to make sure the IDE hardware (ie. host OS) doesn't die unexpectedly. Paul