2015-05-04 22:15:01 +02:00
|
|
|
Set cache mode for target installation disk to unsafe for better
|
|
|
|
performance.
|
2022-03-03 05:17:21 +01:00
|
|
|
Index: virt-manager-3.3.0/virtinst/install/installer.py
|
2014-07-18 01:22:14 +02:00
|
|
|
===================================================================
|
2022-03-03 05:17:21 +01:00
|
|
|
--- virt-manager-3.3.0.orig/virtinst/install/installer.py
|
|
|
|
+++ virt-manager-3.3.0/virtinst/install/installer.py
|
|
|
|
@@ -567,16 +567,29 @@ class Installer(object):
|
2014-05-30 01:00:52 +02:00
|
|
|
|
2022-03-03 05:17:21 +01:00
|
|
|
def _build_postboot_xml(self, final_xml, meter):
|
|
|
|
initial_guest = Guest(self.conn, parsexml=final_xml)
|
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"
|
2022-03-03 05:17:21 +01:00
|
|
|
+ if initial_guest.devices.disk:
|
|
|
|
+ target_disk = initial_guest.devices.disk[0]
|
2018-10-30 23:00:52 +01:00
|
|
|
+ saved_cache = target_disk.driver_cache
|
2020-03-24 21:03:25 +01:00
|
|
|
+ if target_disk.type != DeviceDisk.TYPE_BLOCK and target_disk.driver_io != "native":
|
2018-10-30 23:00:52 +01:00
|
|
|
+ target_disk.driver_cache = DeviceDisk.CACHE_MODE_UNSAFE
|
2015-05-04 22:15:01 +02:00
|
|
|
+
|
2022-03-03 05:17:21 +01:00
|
|
|
self._alter_bootconfig(initial_guest)
|
|
|
|
self._alter_install_resources(initial_guest, meter)
|
|
|
|
if self.has_cloudinit():
|
|
|
|
initial_guest.set_smbios_serial_cloudinit()
|
|
|
|
|
|
|
|
+ install_xml = initial_guest.get_xml()
|
|
|
|
+ if saved_cache != "None":
|
|
|
|
+ target_disk.driver_cache = saved_cache
|
|
|
|
+
|
|
|
|
final_guest = Guest(self.conn, parsexml=final_xml)
|
|
|
|
self._remove_install_cdrom_media(final_guest)
|
|
|
|
self._remove_unattended_install_cdrom_device(final_guest)
|
|
|
|
|
|
|
|
- return initial_guest.get_xml(), final_guest.get_xml()
|
|
|
|
+ return install_xml, final_guest.get_xml()
|
|
|
|
|
|
|
|
def _build_xml(self, guest, meter):
|
|
|
|
initial_xml = None
|