On 05/20/2010 11:32 AM, jes.soren...@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