From: Federico Simoncelli Subject: Re: [Qemu-devel] [PATCH] qemu-img: Add cache command line option Date: Thu, 16 Jun 2011 10:44:35 -0400 (EDT) Message-ID: <578353015.714674.1308235475424.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com> References: <20110616142809.GA9468@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, kwolf@redhat.com, qemu-devel@nongnu.org, avi@redhat.com To: Christoph Hellwig Return-path: Received: from mx4-phx2.redhat.com ([209.132.183.25]:54693 "EHLO mx4-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758090Ab1FPOoj (ORCPT ); Thu, 16 Jun 2011 10:44:39 -0400 In-Reply-To: <20110616142809.GA9468@lst.de> Sender: kvm-owner@vger.kernel.org List-ID: ----- Original Message ----- > From: "Christoph Hellwig" > To: "Federico Simoncelli" > Cc: kvm@vger.kernel.org, kwolf@redhat.com, qemu-devel@nongnu.org, avi@redhat.com > Sent: Thursday, June 16, 2011 4:28:09 PM > Subject: Re: [Qemu-devel] [PATCH] qemu-img: Add cache command line option > On Wed, Jun 15, 2011 at 09:46:10AM -0400, Federico Simoncelli wrote: > > qemu-img currently writes disk images using writeback and filling > > up the cache buffers which are then flushed by the kernel preventing > > other processes from accessing the storage. > > This is particularly bad in cluster environments where time-based > > algorithms might be in place and accessing the storage within > > certain timeouts is critical. > > This patch adds the option to choose a cache method when writing > > disk images. > > Allowing to chose the mode is of course fine, but what about also > choosing a good default? writethrough doesn't really make any sense > for qemu-img, given that we can trivially flush the cache at the end > of the operations. I'd also say that using the buffer cache doesn't > make sense either, as there is little point in caching these > operations. I totally agree with you, I didn't change the default to increase the chances for my patch to be accepted. If we want cache=none as default we can easily change: -#define BDRV_DEFAULT_CACHE "writeback" +#define BDRV_DEFAULT_CACHE "none" -- Federico