]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
xen_disk: support "direct-io-safe" backend option qemu-xen-4.3.0
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 28 Jun 2013 11:23:16 +0000 (11:23 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 28 Jun 2013 11:23:16 +0000 (11:23 +0000)
commit7483e7f15139603380c45ebcd8cc2a57dda5583c
treef5d7ae435441f488771cd2b9fd3558137eeb4b69
parent1c514a7734b7f98625a0d18d5e8ee7581f26e50c
xen_disk: support "direct-io-safe" backend option

Support backend option "direct-io-safe".  This is documented as
follows in the Xen backend specification:

 * direct-io-safe
 *      Values:         0/1 (boolean)
 *      Default Value:  0
 *
 *      The underlying storage is not affected by the direct IO memory
 *      lifetime bug.  See:
 *        http://lists.xen.org/archives/html/xen-devel/2012-12/msg01154.html
 *
 *      Therefore this option gives the backend permission to use
 *      O_DIRECT, notwithstanding that bug.
 *
 *      That is, if this option is enabled, use of O_DIRECT is safe,
 *      in circumstances where we would normally have avoided it as a
 *      workaround for that bug.  This option is not relevant for all
 *      backends, and even not necessarily supported for those for
 *      which it is relevant.  A backend which knows that it is not
 *      affected by the bug can ignore this option.
 *
 *      This option doesn't require a backend to use O_DIRECT, so it
 *      should not be used to try to control the caching behaviour.

Also, BDRV_O_NATIVE_AIO is ignored if BDRV_O_NOCACHE, so clarify the
default flags passed to the qemu block layer.

The original proposal for a "cache" backend option has been dropped
because it was believed too wide, especially considering that at the
moment the backend doesn't have a way to tell the toolstack that it is
capable of supporting it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
hw/xen_disk.c