mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
details: Remove 'detect zeroes' UI
After checking with qemu devs, this option is not really recommended for common usage and doesn't get used much in practice. So I don't think it is suitable for the UI Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
381aa4050c
commit
8377b7f7b6
@ -154,7 +154,6 @@ def testAddDisks(app):
|
||||
tab.find("Serial:", "text").set_text("ZZZZ")
|
||||
tab.combo_select("Cache mode:", "none")
|
||||
tab.combo_select("Discard mode:", "ignore")
|
||||
tab.combo_select("Detect zeroes:", "unmap")
|
||||
# High number but we are non-sparse by default so it won't complain
|
||||
tab.find("GiB", "spin button").set_text("200000")
|
||||
_finish(addhw, check=details)
|
||||
|
@ -414,7 +414,6 @@ def testDetailsEditDiskNet(app):
|
||||
tab.find("Serial:", "text").set_text("1234-ABCD")
|
||||
tab.combo_select("Cache mode:", "unsafe")
|
||||
tab.combo_select("Discard mode:", "unmap")
|
||||
tab.combo_select("Detect zeroes:", "unmap")
|
||||
appl.click()
|
||||
lib.utils.check(lambda: not appl.sensitive)
|
||||
|
||||
|
@ -246,7 +246,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<child>
|
||||
<!-- n-columns=2 n-rows=7 -->
|
||||
<!-- n-columns=2 n-rows=6 -->
|
||||
<object class="GtkGrid" id="table19">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
@ -314,37 +314,6 @@
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label-disk-detect-zeroes">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Detect _zeroes:</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="mnemonic-widget">disk-detect-zeroes</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-detect-zeroes">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="has-entry">True</property>
|
||||
<signal name="changed" handler="on_disk_detect_zeroes_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry">
|
||||
<property name="can-focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="permissions-label">
|
||||
<property name="visible">True</property>
|
||||
|
@ -16,12 +16,11 @@ from ..baseclass import vmmGObjectUI
|
||||
(
|
||||
_EDIT_CACHE,
|
||||
_EDIT_DISCARD,
|
||||
_EDIT_DETECT_ZEROES,
|
||||
_EDIT_RO,
|
||||
_EDIT_SHARE,
|
||||
_EDIT_REMOVABLE,
|
||||
_EDIT_SERIAL,
|
||||
) = range(1, 8)
|
||||
) = range(1, 7)
|
||||
|
||||
|
||||
class vmmAddStorage(vmmGObjectUI):
|
||||
@ -46,7 +45,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
"on_storage_select_toggled": self._toggle_storage_select,
|
||||
"on_disk_cache_combo_changed": _e(_EDIT_CACHE),
|
||||
"on_disk_discard_combo_changed": _e(_EDIT_DISCARD),
|
||||
"on_disk_detect_zeroes_combo_changed": _e(_EDIT_DETECT_ZEROES),
|
||||
"on_disk_readonly_changed": _e(_EDIT_RO),
|
||||
"on_disk_shareable_changed": _e(_EDIT_SHARE),
|
||||
"on_disk_removable_changed": _e(_EDIT_REMOVABLE),
|
||||
@ -110,13 +108,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
uiutil.build_simple_combo(
|
||||
self.widget("disk-discard"), values, sort=False)
|
||||
|
||||
# Detect zeroes combo
|
||||
values = [[None, _("Hypervisor default")]]
|
||||
for m in virtinst.DeviceDisk.DETECT_ZEROES_MODES:
|
||||
values.append([m, m])
|
||||
uiutil.build_simple_combo(
|
||||
self.widget("disk-detect-zeroes"), values, sort=False)
|
||||
|
||||
|
||||
##############
|
||||
# Public API #
|
||||
@ -179,7 +170,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
self.widget("storage-create-box").set_sensitive(True)
|
||||
self.widget("disk-cache").set_active(0)
|
||||
self.widget("disk-discard").set_active(0)
|
||||
self.widget("disk-detect-zeroes").set_active(0)
|
||||
self.widget("disk-serial").set_text("")
|
||||
self.widget("storage-advanced").set_expanded(False)
|
||||
self.widget("disk-readonly").set_active(False)
|
||||
@ -236,8 +226,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
disk.driver_cache = vals.get("cache")
|
||||
if vals.get("discard") is not None:
|
||||
disk.driver_discard = vals.get("discard")
|
||||
if vals.get("detect_zeroes") is not None:
|
||||
disk.driver_detect_zeroes = vals.get("detect_zeroes")
|
||||
if vals.get("readonly") is not None:
|
||||
disk.read_only = vals.get("readonly")
|
||||
if vals.get("shareable") is not None:
|
||||
@ -307,7 +295,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
def set_dev(self, disk):
|
||||
cache = disk.driver_cache
|
||||
discard = disk.driver_discard
|
||||
detect_zeroes = disk.driver_detect_zeroes
|
||||
ro = disk.read_only
|
||||
share = disk.shareable
|
||||
removable = bool(disk.removable)
|
||||
@ -317,8 +304,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
|
||||
uiutil.set_list_selection(self.widget("disk-cache"), cache)
|
||||
uiutil.set_list_selection(self.widget("disk-discard"), discard)
|
||||
uiutil.set_list_selection(
|
||||
self.widget("disk-detect-zeroes"), detect_zeroes)
|
||||
|
||||
self.widget("disk-serial").set_text(serial or "")
|
||||
self.widget("disk-readonly").set_active(ro)
|
||||
@ -339,9 +324,6 @@ class vmmAddStorage(vmmGObjectUI):
|
||||
if _EDIT_DISCARD in self._active_edits:
|
||||
ret["discard"] = uiutil.get_list_selection(
|
||||
self.widget("disk-discard"))
|
||||
if _EDIT_DETECT_ZEROES in self._active_edits:
|
||||
ret["detect_zeroes"] = uiutil.get_list_selection(
|
||||
self.widget("disk-detect-zeroes"))
|
||||
if _EDIT_RO in self._active_edits:
|
||||
ret["readonly"] = self.widget("disk-readonly").get_active()
|
||||
if _EDIT_SHARE in self._active_edits:
|
||||
|
@ -777,7 +777,7 @@ class vmmDomain(vmmLibvirtObject):
|
||||
def define_disk(self, devobj, do_hotplug,
|
||||
path=_SENTINEL, readonly=_SENTINEL,
|
||||
shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL,
|
||||
discard=_SENTINEL, detect_zeroes=_SENTINEL, bus=_SENTINEL,
|
||||
discard=_SENTINEL, bus=_SENTINEL,
|
||||
serial=_SENTINEL):
|
||||
xmlobj = self._make_xmlobj_to_define()
|
||||
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
|
||||
@ -802,8 +802,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
editdev.driver_cache = cache or None
|
||||
if discard != _SENTINEL:
|
||||
editdev.driver_discard = discard or None
|
||||
if detect_zeroes != _SENTINEL:
|
||||
editdev.driver_detect_zeroes = detect_zeroes or None
|
||||
|
||||
if bus != _SENTINEL:
|
||||
editdev.change_bus(self.xmlobj, bus)
|
||||
|
@ -193,12 +193,6 @@ class DeviceDisk(Device):
|
||||
DISCARD_MODE_UNMAP = "unmap"
|
||||
DISCARD_MODES = [DISCARD_MODE_IGNORE, DISCARD_MODE_UNMAP]
|
||||
|
||||
DETECT_ZEROES_MODE_OFF = "off"
|
||||
DETECT_ZEROES_MODE_ON = "on"
|
||||
DETECT_ZEROES_MODE_UNMAP = "unmap"
|
||||
DETECT_ZEROES_MODES = [DETECT_ZEROES_MODE_OFF, DETECT_ZEROES_MODE_ON,
|
||||
DETECT_ZEROES_MODE_UNMAP]
|
||||
|
||||
DEVICE_DISK = "disk"
|
||||
DEVICE_LUN = "lun"
|
||||
DEVICE_CDROM = "cdrom"
|
||||
|
Loading…
Reference in New Issue
Block a user