From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KoYNM-0007Jj-2Z for qemu-devel@nongnu.org; Sat, 11 Oct 2008 02:54:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KoYNL-0007JM-34 for qemu-devel@nongnu.org; Sat, 11 Oct 2008 02:54:55 -0400 Received: from [199.232.76.173] (port=42935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoYNK-0007JJ-TQ for qemu-devel@nongnu.org; Sat, 11 Oct 2008 02:54:54 -0400 Received: from mx20.gnu.org ([199.232.41.8]:9046) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KoYNK-0002Eg-7v for qemu-devel@nongnu.org; Sat, 11 Oct 2008 02:54:54 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KoYNI-0002zF-TQ for qemu-devel@nongnu.org; Sat, 11 Oct 2008 02:54:53 -0400 Message-ID: <48F04DB4.5090807@redhat.com> Date: Sat, 11 Oct 2008 08:54:44 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Expand cache= option and use write-through caching by default References: <1223671759-26576-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1223671759-26576-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 Cc: Anthony Liguori , kvm@vger.kernel.org Anthony Liguori wrote: > This patch changes the cache= option to accept none, writeback, or writethough > to control the host page cache behavior. By default, writethrough caching is > now used which internally is implemented by using O_DSYNC to open the disk > images. When using -snapshot, writeback is used by default since data integrity > it not at all an issue. > > cache=none has the same behavior as cache=off previously. The later syntax is > still supported by now deprecated. I also cleaned up the O_DIRECT > implementation to avoid many of the #ifdefs. > > Looks good. > @@ -8069,7 +8075,7 @@ static void help(int exitcode) > "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" > "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n" > " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n" > - " [,cache=on|off][,format=f]\n" > + " [,cache=writethrough|writeback|none][,format=f]\n" > " use 'file' as a drive image\n" > "-mtdblock file use 'file' as on-board Flash memory image\n" > "-sd file use 'file' as SecureDigital card image\n" > > Might want to specify the default, and also document it in the manual. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.