2015-05-04 22:15:01 +02:00
|
|
|
Set cache mode for target installation disk to unsafe for better
|
|
|
|
performance.
|
2018-10-30 23:00:52 +01:00
|
|
|
Index: virt-manager-2.0.0/virtinst/installer.py
|
2014-07-18 01:22:14 +02:00
|
|
|
===================================================================
|
2018-10-30 23:00:52 +01:00
|
|
|
--- virt-manager-2.0.0.orig/virtinst/installer.py
|
|
|
|
+++ virt-manager-2.0.0/virtinst/installer.py
|
|
|
|
@@ -294,10 +294,21 @@ class Installer(object):
|
|
|
|
guest.os.kernel_args, guest.on_reboot) = data
|
2014-05-30 01:00:52 +02:00
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
def _get_install_xml(self, guest):
|
2014-12-01 21:20:03 +01:00
|
|
|
+ # At install time set the target disk to 'unsafe' for
|
|
|
|
+ # better performance if the target is not a block device
|
2015-11-17 17:10:20 +01:00
|
|
|
+ saved_cache = "None"
|
2018-10-30 23:00:52 +01:00
|
|
|
+ if guest.devices.disk:
|
|
|
|
+ target_disk = guest.devices.disk[0]
|
|
|
|
+ saved_cache = target_disk.driver_cache
|
|
|
|
+ if target_disk.type != DeviceDisk.TYPE_BLOCK:
|
|
|
|
+ target_disk.driver_cache = DeviceDisk.CACHE_MODE_UNSAFE
|
2015-05-04 22:15:01 +02:00
|
|
|
+
|
2018-10-30 23:00:52 +01:00
|
|
|
data = self._prepare_get_install_xml(guest)
|
|
|
|
try:
|
|
|
|
self._alter_bootconfig(guest)
|
|
|
|
ret = guest.get_xml()
|
|
|
|
+ if saved_cache != "None":
|
|
|
|
+ target_disk.driver_cache = saved_cache
|
|
|
|
return ret
|
|
|
|
finally:
|
|
|
|
self._remove_install_cdrom_media(guest)
|