summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKashyap Chamarthy <kchamart@redhat.com>2019-03-14 14:20:33 +0100
committerKashyap Chamarthy <kchamart@redhat.com>2019-03-21 14:17:22 +0100
commit425f17e2af864c8c3068044be70f05180ec79b1b (patch)
treedc50c0ae42164c16dffc76958e8513327040d0b7
parent44edfa045c69b18b0a991475cb9c1d87b5941d52 (diff)
downloadnova-425f17e2af864c8c3068044be70f05180ec79b1b.tar.gz
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>
-rw-r--r--nova/tests/unit/virt/libvirt/volume/test_smbfs.py1
-rw-r--r--nova/virt/libvirt/volume/smbfs.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/nova/tests/unit/virt/libvirt/volume/test_smbfs.py b/nova/tests/unit/virt/libvirt/volume/test_smbfs.py
index b39a4ebad8..2c3ea574a9 100644
--- a/nova/tests/unit/virt/libvirt/volume/test_smbfs.py
+++ b/nova/tests/unit/virt/libvirt/volume/test_smbfs.py
@@ -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')
diff --git a/nova/virt/libvirt/volume/smbfs.py b/nova/virt/libvirt/volume/smbfs.py
index 02534be0d0..d112af750c 100644
--- a/nova/virt/libvirt/volume/smbfs.py
+++ b/nova/virt/libvirt/volume/smbfs.py
@@ -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