virt-manager/virtinst-set-cache-mode-unsafe-for-install.patch
Charles Arnold 38097ad9c3 - bsc#1156964 - import a exist disk for creating PV guest failed
virtinst-pvgrub2-bootloader.patch
- Refreshed patches
  virtinst-change-location-for-grub_xen.patch
  virtinst-set-cache-mode-unsafe-for-install.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=492
2019-11-27 22:13:48 +00:00

30 lines
1.2 KiB
Diff

Set cache mode for target installation disk to unsafe for better
performance.
Index: virt-manager-2.2.1/virtinst/install/installer.py
===================================================================
--- virt-manager-2.2.1.orig/virtinst/install/installer.py
+++ virt-manager-2.2.1/virtinst/install/installer.py
@@ -422,11 +422,22 @@ class Installer(object):
guest.memory) = data
def _get_install_xml(self, guest, meter):
+ # At install time set the target disk to 'unsafe' for
+ # better performance if the target is not a block device
+ saved_cache = "None"
+ 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
+
data = self._prepare_get_install_xml(guest)
try:
self._alter_bootconfig(guest)
self._alter_install_resources(guest, meter)
ret = guest.get_xml()
+ if saved_cache != "None":
+ target_disk.driver_cache = saved_cache
return ret
finally:
self._remove_install_cdrom_media(guest)