mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
virtManager: Only allow editing disk bus for new VM
This was proposed here: https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html """ * disk: bus editing: maybe keep this for the customize wizard, but it should go away for existing disks, changing it for an existing VM is definitely a 'shoot yourself in the foot' type of thing for most users """ Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
7547905d79
commit
137b73df75
@ -227,15 +227,8 @@ class Details(uiutils.UITestCase):
|
||||
tab.find("Shareable:", "check box").click()
|
||||
tab.find("Readonly:", "check box").click()
|
||||
tab.find("Advanced options", "toggle button").click_expander()
|
||||
tab.find("Disk bus:", "text").text = "usb"
|
||||
tab.find("Performance options", "toggle button").click_expander()
|
||||
tab.find("Cache mode:", "text").text = "unsafe"
|
||||
appl.click()
|
||||
uiutils.check_in_loop(lambda: not appl.sensitive)
|
||||
# Device is now 'USB Disk 1'
|
||||
c = hwlist.find("USB Disk 1", "table cell")
|
||||
self.assertTrue(c.state_selected)
|
||||
tab.find("Removable:", "check box").click()
|
||||
tab.find("Discard mode:", "text").text = "unmap"
|
||||
appl.click()
|
||||
uiutils.check_in_loop(lambda: not appl.sensitive)
|
||||
|
||||
|
@ -195,6 +195,21 @@ class NewVM(uiutils.UITestCase):
|
||||
addhw.find("Finish", "push button").click()
|
||||
uiutils.check_in_loop(lambda: vmwindow.active)
|
||||
|
||||
# Select the new disk, change the bus to USB
|
||||
vmwindow.find_fuzzy("IDE Disk 2", "table cell").click()
|
||||
appl = vmwindow.find("config-apply", "push button")
|
||||
hwlist = vmwindow.find("hw-list")
|
||||
tab = vmwindow.find("disk-tab")
|
||||
tab.find("Disk bus:", "text").text = "usb"
|
||||
appl.click()
|
||||
uiutils.check_in_loop(lambda: not appl.sensitive)
|
||||
# Device is now 'USB Disk 1'
|
||||
c = hwlist.find("USB Disk 1", "table cell")
|
||||
self.assertTrue(c.state_selected)
|
||||
tab.find("Removable:", "check box").click()
|
||||
appl.click()
|
||||
uiutils.check_in_loop(lambda: not appl.sensitive)
|
||||
|
||||
# Start the install, close via the VM window
|
||||
vmwindow.find_fuzzy("Begin Installation", "button").click()
|
||||
uiutils.check_in_loop(lambda: newvm.showing is False)
|
||||
|
274
ui/details.ui
274
ui/details.ui
@ -2705,7 +2705,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2719,7 +2719,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2732,7 +2732,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2746,7 +2746,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2758,7 +2758,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2770,7 +2770,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2896,7 +2896,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -2911,7 +2911,63 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="top_attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="disk-bus-labeller">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Disk b_us:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-bus-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-bus">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="has_entry">True</property>
|
||||
<signal name="changed" handler="on_disk_bus_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="disk-bus-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="disk-bus-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">disk-bus-label</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
@ -2932,19 +2988,19 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="table11">
|
||||
<object class="GtkGrid" id="table19">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">3</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label32">
|
||||
<object class="GtkLabel" id="label123">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Disk b_us:</property>
|
||||
<property name="label" translatable="yes">Cac_he mode:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-bus-text</property>
|
||||
<property name="mnemonic_widget">disk-cache-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
@ -2952,13 +3008,13 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-bus">
|
||||
<object class="GtkComboBox" id="disk-cache">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="has_entry">True</property>
|
||||
<signal name="changed" handler="on_disk_bus_combo_changed" swapped="no"/>
|
||||
<signal name="changed" handler="on_disk_cache_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="disk-bus-text">
|
||||
<object class="GtkEntry" id="disk-cache-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
@ -2968,6 +3024,68 @@
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label-disk-discard">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Discard mod_e:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-discard-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-discard">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="has_entry">True</property>
|
||||
<signal name="changed" handler="on_disk_discard_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="disk-discard-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</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-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</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" id="disk-detect-zeroes-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@ -2975,132 +3093,6 @@
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander8">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="table19">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">3</property>
|
||||
<property name="column_spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label123">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Cac_he mode:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-cache-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-cache">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="has_entry">True</property>
|
||||
<signal name="changed" handler="on_disk_cache_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="disk-cache-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label-disk-discard">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">Discard mod_e:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">disk-discard-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="disk-discard">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="has_entry">True</property>
|
||||
<signal name="changed" handler="on_disk_discard_combo_changed" swapped="no"/>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="disk-discard-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</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-text</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</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" id="disk-detect-zeroes-text">
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label78">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">_Performance options</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
|
@ -846,6 +846,12 @@ class vmmDetails(vmmGObjectUI):
|
||||
# Disk bus combo
|
||||
disk_bus = self.widget("disk-bus")
|
||||
vmmAddHardware.build_disk_bus_combo(self.vm, disk_bus)
|
||||
self.widget("disk-bus-label").set_visible(
|
||||
not self.is_customize_dialog)
|
||||
self.widget("disk-bus").set_visible(self.is_customize_dialog)
|
||||
if not self.is_customize_dialog:
|
||||
# Remove the mnemonic
|
||||
self.widget("disk-bus-labeller").set_text(_("Disk bus:"))
|
||||
|
||||
# Network model
|
||||
net_model = self.widget("network-model")
|
||||
@ -2174,6 +2180,8 @@ class vmmDetails(vmmGObjectUI):
|
||||
vmmAddHardware.populate_disk_bus_combo(self.vm, devtype,
|
||||
self.widget("disk-bus").get_model())
|
||||
uiutil.set_list_selection(self.widget("disk-bus"), bus)
|
||||
self.widget("disk-bus-label").set_text(
|
||||
vmmAddHardware.disk_pretty_bus(bus) or "-")
|
||||
|
||||
is_removable = disk.is_cdrom() or disk.is_floppy()
|
||||
self.widget("disk-source-box").set_visible(is_removable)
|
||||
|
Loading…
Reference in New Issue
Block a user