virt-manager/virtinst-set-cache-mode-unsafe-for-install.patch

30 lines
1016 B
Diff
Raw Normal View History

Index: virt-manager-1.0.1/virtinst/guest.py
===================================================================
--- virt-manager-1.0.1.orig/virtinst/guest.py
+++ virt-manager-1.0.1/virtinst/guest.py
@@ -346,6 +346,12 @@ class Guest(XMLBuilder):
self.on_reboot = action
self.on_crash = action
+ # At install time only set the target disk to 'unsafe' for
+ # better performance
+ if install:
+ target_disk = self.get_devices("disk")[0]
+ saved_cache = target_disk.driver_cache
+ target_disk.driver_cache = "unsafe"
self._set_defaults()
self.bootloader = None
@@ -365,7 +371,10 @@ class Guest(XMLBuilder):
self.bootloader = "/usr/bin/pygrub"
self.os.clear()
- return self.get_xml_config()
+ xml_config = self.get_xml_config()
+ if install:
+ target_disk.driver_cache = saved_cache
+ return xml_config
def get_continue_inst(self):
"""