qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] QEMU: Change default disk caching to nocach


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH] QEMU: Change default disk caching to nocache
Date: Thu, 20 May 2010 13:56:43 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 05/20/2010 10:24 AM, Paolo Bonzini wrote:
On 05/20/2010 11:32 AM, address@hidden 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]