Skip to content
Snippets Groups Projects
Commit c1f98a66 authored by Filippos Giannakos's avatar Filippos Giannakos
Browse files

Enhance cache settings for userspace URI

parent cf60c85a
No related branches found
No related tags found
No related merge requests found
...@@ -301,9 +301,17 @@ def format_qemu_uri(name, pool=None, cephx=None, conf_file=None, cache=None, ...@@ -301,9 +301,17 @@ def format_qemu_uri(name, pool=None, cephx=None, conf_file=None, cache=None,
extra_conf += ':id=%s' % cephx['id'] extra_conf += ':id=%s' % cephx['id']
if conf_file: if conf_file:
extra_conf += ':conf=%s' % conf_file extra_conf += ':conf=%s' % conf_file
# TODO: we need to revisit this, to support more caching modes correctly. # We need to set these here to override the settings in 'ceph.conf'
if cache in ['writeback']: # They are consistent with how QEMU treats the cache settings for an RBD
# drive.
if cache in ['writeback', 'writethrough', 'unsafe']:
extra_conf += ':rbd_cache=true' extra_conf += ':rbd_cache=true'
if cache == 'writethrough':
# To ensure that the cache is set in writethrough mode.
# QEMU alone, does not set this value when 'cache=writethrough' is set,
# although if 'ceph.conf' does not says otherwise, 'rbd_cache' is set
# to true.
extra_conf += ':rbd_cache_max_dirty=0'
for k, v in kwargs.iteritems(): for k, v in kwargs.iteritems():
extra_conf += ':%s=%s' % (k, v) extra_conf += ':%s=%s' % (k, v)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment