virt-manager/virtinst-set-cache-mode-unsafe-for-install.patch
Charles Arnold b78bd34b50 - bnc#909225 - pygrub Unable to find partition containing kernel
Update virtinst-pvgrub2-bootloader.patch

- Reorder virt-manager patches according to type
- Drop virtman-cdrom.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=216
2015-01-05 18:16:33 +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
@@ -31,6 +31,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
@@ -348,6 +349,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
@@ -366,7 +374,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):
"""