virt-manager/virtinst-vol-default-nocow.patch

22 lines
742 B
Diff
Raw Normal View History

Set NOCOW flag to newly created volume by default, to solve performance
issue on btrfs.
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Index: virt-manager-1.0.0/virtinst/storage.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/storage.py
+++ virt-manager-1.0.0/virtinst/storage.py
@@ -656,6 +656,11 @@ class StorageVolume(_StorageObject):
lazy_refcounts = XMLProperty("./target/features/lazy_refcounts",
is_bool=True, default_cb=_lazy_refcounts_default_cb)
+ def _nocow_default_cb(self):
+ return True
+ nocow = XMLProperty("./target/nocow",
+ is_bool=True, default_cb=_nocow_default_cb)
+
######################
# Public API helpers #