libvirt: smbfs: Use 'writeback' QEMU cache mode

The 'writethrough' cache mode is terribly slow.  Use the saner
alternative, "writeback" cache mode.

See further details in the documentation of change Ibe236988af2
("libvirt: Use 'writeback' QEMU cache mode when 'none' is not viable).

Related-Bug: #1818847

Change-Id: I2d84c8576c01202fa4ec73a57aa739e2a2f66d06
Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com>
This commit is contained in:
Kashyap Chamarthy 2019-03-14 14:20:33 +01:00
parent 44edfa045c
commit 425f17e2af
2 changed files with 2 additions and 1 deletions

View File

@ -83,6 +83,7 @@ class LibvirtSMBFSVolumeDriverTestCase(test_volume.LibvirtVolumeBaseTestCase):
conf = libvirt_driver.get_config(connection_info, self.disk_info)
tree = conf.format_dom()
self._assertFileTypeEquals(tree, file_path)
self.assertEqual('writeback', conf.driver_cache)
@mock.patch.object(libvirt_utils, 'is_mounted')
@mock.patch('oslo_utils.fileutils.ensure_tree')

View File

@ -34,7 +34,7 @@ class LibvirtSMBFSVolumeDriver(fs.LibvirtBaseFileSystemVolumeDriver):
self).get_config(connection_info, disk_info)
conf.source_type = 'file'
conf.driver_cache = 'writethrough'
conf.driver_cache = 'writeback'
conf.source_path = connection_info['data']['device_path']
conf.driver_format = connection_info['data'].get('format', 'raw')
return conf