virt-manager/virtinst-set-cache-mode-unsafe-for-install.patch
Charles Arnold 572c97ee60 - bnc#907324 - libvirt: unsupported configuration: native I/O needs
either no disk cache or directsync cache mode, QEMU will fallback
  to aio=threads
  virtinst-set-cache-mode-unsafe-for-install.patch updated

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=212
2014-12-01 20:20:03 +00:00

39 lines
1.4 KiB
Diff

Index: virt-manager-1.1.0/virtinst/guest.py
===================================================================
--- virt-manager-1.1.0.orig/virtinst/guest.py
+++ virt-manager-1.1.0/virtinst/guest.py
@@ -32,6 +32,7 @@ from virtinst import util
from virtinst import support
from virtinst import OSXML
from virtinst import VirtualDevice
+from virtinst import VirtualDisk
from virtinst import Clock
from virtinst import Seclabel
from virtinst import CPU
@@ -349,6 +350,13 @@ class Guest(XMLBuilder):
self.on_crash = action
self._set_defaults()
+ # At install time set the target disk to 'unsafe' for
+ # better performance if the target is not a block device
+ if install:
+ target_disk = self.get_devices("disk")[0]
+ saved_cache = target_disk.driver_cache
+ if target_disk.type != VirtualDisk.TYPE_BLOCK:
+ target_disk.driver_cache = VirtualDisk.CACHE_MODE_UNSAFE
self.bootloader = None
if (not install and
@@ -367,7 +375,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):
"""