From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Qemu-devel] [PATCH] Expand cache= option and use write-through caching by default Date: Sat, 11 Oct 2008 08:54:44 +0200 Message-ID: <48F04DB4.5090807@redhat.com> References: <1223671759-26576-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:33207 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761310AbYJKGyz (ORCPT ); Sat, 11 Oct 2008 02:54:55 -0400 In-Reply-To: <1223671759-26576-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.