From: Anthony Liguori <anthony@codemonkey.ws>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: hch@infradead.org, Jes.Sorensen@redhat.com,
qemu-devel@nongnu.org, crobinso@redhat.com
Subject: Re: [Qemu-devel] Re: [PATCH] QEMU: Change default disk caching to nocache
Date: Thu, 20 May 2010 13:56:43 -0500 [thread overview]
Message-ID: <4BF585EB.7090209@codemonkey.ws> (raw)
In-Reply-To: <4BF5542F.1030004@redhat.com>
On 05/20/2010 10:24 AM, Paolo Bonzini wrote:
> 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?
It used to be that we had a CACHE_DEFAULT which allowed qcow2 to do
CACHE_WB by default whereas everything else did CACHE_WT. The same
technique could be used to let physical devices do NOCACHE by default.
Regards,
Anthony Liguori
> Paolo
>
next prev parent reply other threads:[~2010-05-20 18:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 9:32 [Qemu-devel] [PATCH] QEMU: change default disk cache behavior Jes.Sorensen
2010-05-20 9:32 ` [Qemu-devel] [PATCH] QEMU: Change default disk caching to nocache Jes.Sorensen
2010-05-20 15:24 ` [Qemu-devel] " Paolo Bonzini
2010-05-20 18:56 ` Anthony Liguori [this message]
2010-05-20 12:30 ` [Qemu-devel] [PATCH] QEMU: change default disk cache behavior Anthony Liguori
2010-05-20 13:36 ` Jes Sorensen
2010-05-20 13:40 ` Anthony Liguori
2010-05-20 13:49 ` Jes Sorensen
2010-05-20 14:05 ` Stefan Hajnoczi
2010-05-20 18:58 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BF585EB.7090209@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=Jes.Sorensen@redhat.com \
--cc=crobinso@redhat.com \
--cc=hch@infradead.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).