virtManager: Remove disk serial UI

This was proposed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

"""
* disk: serial: I know this is useful in some cases but seems quite
obscure. I think the XML editor is fine unless there's some common
usecase I'm missing
"""

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-25 12:36:03 -05:00
parent bd82ef6529
commit 1066867583
4 changed files with 2 additions and 39 deletions

View File

@ -229,7 +229,6 @@ class Details(uiutils.UITestCase):
tab.find("Readonly:", "check box").click() tab.find("Readonly:", "check box").click()
tab.find("Advanced options", "toggle button").click_expander() tab.find("Advanced options", "toggle button").click_expander()
tab.find("Storage format:", "text").text = "vmdk" tab.find("Storage format:", "text").text = "vmdk"
tab.find("Serial number:", "text").text = "1234-ABCD"
tab.find("Disk bus:", "text").text = "usb" tab.find("Disk bus:", "text").text = "usb"
tab.find("Performance options", "toggle button").click_expander() tab.find("Performance options", "toggle button").click_expander()
tab.find("IO mode:", "text").text = "threads" tab.find("IO mode:", "text").text = "threads"

View File

@ -3060,19 +3060,6 @@
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkEntry" id="disk-serial">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="width_chars">20</property>
<signal name="changed" handler="on_disk_serial_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child> <child>
<object class="GtkComboBox" id="disk-bus"> <object class="GtkComboBox" id="disk-bus">
<property name="visible">True</property> <property name="visible">True</property>
@ -3090,20 +3077,6 @@
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Seria_l number:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">disk-serial</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child> <child>
<object class="GtkBox" id="box15"> <object class="GtkBox" id="box15">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -62,7 +62,6 @@ from ..xmleditor import vmmXMLEditor
EDIT_DISK_DISCARD, EDIT_DISK_DISCARD,
EDIT_DISK_DETECT_ZEROES, EDIT_DISK_DETECT_ZEROES,
EDIT_DISK_BUS, EDIT_DISK_BUS,
EDIT_DISK_SERIAL,
EDIT_DISK_FORMAT, EDIT_DISK_FORMAT,
EDIT_DISK_SGIO, EDIT_DISK_SGIO,
EDIT_DISK_PATH, EDIT_DISK_PATH,
@ -102,7 +101,7 @@ from ..xmleditor import vmmXMLEditor
EDIT_FS, EDIT_FS,
EDIT_HOSTDEV_ROMBAR) = range(1, 57) EDIT_HOSTDEV_ROMBAR) = range(1, 56)
# Columns in hw list model # Columns in hw list model
@ -503,7 +502,6 @@ class vmmDetails(vmmGObjectUI):
"on_disk_detect_zeroes_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_DETECT_ZEROES), "on_disk_detect_zeroes_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_DETECT_ZEROES),
"on_disk_bus_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_BUS), "on_disk_bus_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_BUS),
"on_disk_format_changed": self.disk_format_changed, "on_disk_format_changed": self.disk_format_changed,
"on_disk_serial_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SERIAL),
"on_disk_sgio_entry_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SGIO), "on_disk_sgio_entry_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SGIO),
"on_disk_pr_checkbox_toggled": lambda *x: self.enable_apply(x, EDIT_DISK_PR), "on_disk_pr_checkbox_toggled": lambda *x: self.enable_apply(x, EDIT_DISK_PR),
@ -1734,9 +1732,6 @@ class vmmDetails(vmmGObjectUI):
if self.edited(EDIT_DISK_FORMAT): if self.edited(EDIT_DISK_FORMAT):
kwargs["driver_type"] = self.widget("disk-format").get_text() kwargs["driver_type"] = self.widget("disk-format").get_text()
if self.edited(EDIT_DISK_SERIAL):
kwargs["serial"] = self.get_text("disk-serial")
if self.edited(EDIT_DISK_SGIO): if self.edited(EDIT_DISK_SGIO):
sgio = uiutil.get_list_selection(self.widget("disk-sgio")) sgio = uiutil.get_list_selection(self.widget("disk-sgio"))
kwargs["sgio"] = sgio kwargs["sgio"] = sgio
@ -2270,7 +2265,6 @@ class vmmDetails(vmmGObjectUI):
discard = disk.driver_discard discard = disk.driver_discard
detect_zeroes = disk.driver_detect_zeroes detect_zeroes = disk.driver_detect_zeroes
driver_type = disk.driver_type or "" driver_type = disk.driver_type or ""
serial = disk.serial
size = "-" size = "-"
if path: if path:
@ -2321,7 +2315,6 @@ class vmmDetails(vmmGObjectUI):
vmmAddHardware.populate_disk_bus_combo(self.vm, devtype, vmmAddHardware.populate_disk_bus_combo(self.vm, devtype,
self.widget("disk-bus").get_model()) self.widget("disk-bus").get_model())
uiutil.set_list_selection(self.widget("disk-bus"), bus) uiutil.set_list_selection(self.widget("disk-bus"), bus)
self.widget("disk-serial").set_text(serial or "")
is_removable = disk.is_cdrom() or disk.is_floppy() is_removable = disk.is_cdrom() or disk.is_floppy()
self.widget("disk-source-box").set_visible(is_removable) self.widget("disk-source-box").set_visible(is_removable)

View File

@ -655,7 +655,7 @@ class vmmDomain(vmmLibvirtObject):
###################### ######################
def define_disk(self, devobj, do_hotplug, def define_disk(self, devobj, do_hotplug,
path=_SENTINEL, readonly=_SENTINEL, serial=_SENTINEL, path=_SENTINEL, readonly=_SENTINEL,
shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL, shareable=_SENTINEL, removable=_SENTINEL, cache=_SENTINEL,
io=_SENTINEL, discard=_SENTINEL, detect_zeroes=_SENTINEL, io=_SENTINEL, discard=_SENTINEL, detect_zeroes=_SENTINEL,
driver_type=_SENTINEL, bus=_SENTINEL, addrstr=_SENTINEL, driver_type=_SENTINEL, bus=_SENTINEL, addrstr=_SENTINEL,
@ -713,8 +713,6 @@ class vmmDomain(vmmLibvirtObject):
editdev.driver_detect_zeroes = detect_zeroes or None editdev.driver_detect_zeroes = detect_zeroes or None
if driver_type != _SENTINEL: if driver_type != _SENTINEL:
editdev.driver_type = driver_type or None editdev.driver_type = driver_type or None
if serial != _SENTINEL:
editdev.serial = serial or None
if sgio != _SENTINEL: if sgio != _SENTINEL:
editdev.sgio = sgio or None editdev.sgio = sgio or None