From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38058 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OC9R9-0001H8-Vj for qemu-devel@nongnu.org; Wed, 12 May 2010 06:46:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OC9Ps-0001yl-Qs for qemu-devel@nongnu.org; Wed, 12 May 2010 06:43:54 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:35587) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OC9Ps-0001yh-IQ for qemu-devel@nongnu.org; Wed, 12 May 2010 06:43:52 -0400 Received: by vws10 with SMTP id 10so780624vws.4 for ; Wed, 12 May 2010 03:43:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20100512094257.GA16879@shareable.org> References: <1273528310-7051-1-git-send-email-agraf@suse.de> <4BE881CB.3070303@codemonkey.ws> <4BE884E0.5020703@codemonkey.ws> <20100511214832.GC30446@shareable.org> <20100512094257.GA16879@shareable.org> Date: Wed, 12 May 2010 11:43:51 +0100 Message-ID: Subject: Re: [Qemu-devel] [PATCH 0/2] Enable qemu block layer to not flush From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: kwolf@redhat.com, g@shareable.org, qemu-devel@nongnu.org, Alexander Graf , hch@lst.de On Wed, May 12, 2010 at 10:42 AM, Jamie Lokier wrote: > Stefan Hajnoczi wrote: >> Why add a nop AIO operation instead of setting >> BlockDriverState->enable_write_cache to zero? =A0In that case no write >> cache would be reported to the guest (just like cache=3Dwritethrough). > > Hmm. =A0If the guest sees write cache absent, that prevents changing the > cache policy on the host later (from not flushing to flushing), which > you might want to do after an OS install has finished and booted up. Right. There are 3 cases from the guest perspective: 1. Disable write cache or no write cache. Flushing not needed. 2. Disable flushing but leave write cache enabled. 3. Enable write cache and use flushing. When we don't report a write cache at all, the guest is always stuck at 1. If you're going to do this for installs and other temporary workloads, then enabling the write cache again isn't an issue. After installing successfully, restart the guest with a sane cache=3D mode. Stefan