2015-05-04 22:15:01 +02:00
|
|
|
Set cache mode for target installation disk to unsafe for better
|
|
|
|
performance.
|
2015-11-26 00:27:12 +01:00
|
|
|
Index: virt-manager-1.3.0/virtinst/guest.py
|
2014-07-18 01:22:14 +02:00
|
|
|
===================================================================
|
2015-11-26 00:27:12 +01:00
|
|
|
--- virt-manager-1.3.0.orig/virtinst/guest.py
|
|
|
|
+++ virt-manager-1.3.0/virtinst/guest.py
|
2015-06-08 14:36:45 +02:00
|
|
|
@@ -53,6 +53,7 @@ from .osxml import OSXML
|
2015-05-04 22:15:01 +02:00
|
|
|
from .pm import PM
|
|
|
|
from .seclabel import Seclabel
|
|
|
|
from .xmlbuilder import XMLBuilder, XMLProperty, XMLChildProperty
|
|
|
|
+from .devicedisk import VirtualDisk
|
|
|
|
|
|
|
|
|
|
|
|
class Guest(XMLBuilder):
|
2015-11-26 00:27:12 +01:00
|
|
|
@@ -361,6 +362,17 @@ class Guest(XMLBuilder):
|
2015-06-08 14:36:45 +02:00
|
|
|
|
|
|
|
self._set_osxml_defaults()
|
2014-05-30 01:00:52 +02:00
|
|
|
|
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"
|
2014-05-30 01:00:52 +02:00
|
|
|
+ if install:
|
2015-11-17 17:10:20 +01:00
|
|
|
+ disk_devices = self.get_devices("disk")
|
|
|
|
+ if disk_devices:
|
|
|
|
+ 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
|
2015-05-04 22:15:01 +02:00
|
|
|
+
|
2014-05-30 01:00:52 +02:00
|
|
|
self.bootloader = None
|
2014-12-01 21:20:03 +01:00
|
|
|
if (not install and
|
2015-05-04 22:15:01 +02:00
|
|
|
self.os.is_xenpv() and
|
2015-11-26 00:27:12 +01:00
|
|
|
@@ -379,7 +391,10 @@ class Guest(XMLBuilder):
|
2014-05-30 01:00:52 +02:00
|
|
|
self.bootloader = "/usr/bin/pygrub"
|
|
|
|
self.os.clear()
|
|
|
|
|
|
|
|
- return self.get_xml_config()
|
|
|
|
+ xml_config = self.get_xml_config()
|
2015-11-17 17:10:20 +01:00
|
|
|
+ if install and saved_cache != "None":
|
2014-05-30 01:00:52 +02:00
|
|
|
+ target_disk.driver_cache = saved_cache
|
|
|
|
+ return xml_config
|
|
|
|
|
2015-05-04 22:15:01 +02:00
|
|
|
|
2015-11-26 00:27:12 +01:00
|
|
|
###########################
|