From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45027 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF7c4-0002Fx-Ur for qemu-devel@nongnu.org; Thu, 20 May 2010 11:24:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF7bw-0004PI-FZ for qemu-devel@nongnu.org; Thu, 20 May 2010 11:24:41 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:55743) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF7bw-0004P8-9w for qemu-devel@nongnu.org; Thu, 20 May 2010 11:24:36 -0400 Received: by wwd20 with SMTP id 20so299585wwd.4 for ; Thu, 20 May 2010 08:24:35 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4BF5542F.1030004@redhat.com> Date: Thu, 20 May 2010 17:24:31 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1274347924-9188-1-git-send-email-Jes.Sorensen@redhat.com> <1274347924-9188-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1274347924-9188-2-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] QEMU: Change default disk caching to nocache List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: hch@infradead.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, crobinso@redhat.com On 05/20/2010 11:32 AM, Jes.Sorensen@redhat.com wrote: > + if (bdrv_flags & BDRV_O_NOCACHE) { > + fprintf(stderr, "qemu: failed to open disk image %s as " > + "nocache (O_DIRECT) retrying as write-back\n", file); > + bdrv_flags &= BDRV_O_NOCACHE; Missing ~ here. > + bdrv_flags |= BDRV_O_CACHE_WB; > + if (bdrv_open(dinfo->bdrv, file, bdrv_flags, drv)< 0) > + goto error_open; > + } else { I think the retry should be done silently if no cache= option is given. That is cache=none will be the default but: - if it is not specified and not supported by the image, fall back to writeback with no warning. However, this is just a QoI issue and can be fixed later. - if it is specified and not supported by the image, either fall back to writeback with a warning, or fail altogether. The former would be a change in behavior, so it has to be documented somewhere if it changes. Or maybe add BDRV_O_CACHE_WT and let the backend decide the default? Paolo