mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-08-22 09:49:32 +03:00
details: Don't allow changing machine type for existing VM
But still allow it from the customize dialog. It's one of those things that rarely can be changed for a working VM and things continue to work.
This commit is contained in:
@ -959,7 +959,7 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="overview-machine-label">
|
<object class="GtkLabel" id="machine-type-title">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="valign">start</property>
|
<property name="valign">start</property>
|
||||||
@ -972,18 +972,6 @@
|
|||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkComboBox" id="machine-type">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<signal name="changed" handler="on_machine_type_changed" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="overview-chipset-title">
|
<object class="GtkLabel" id="overview-chipset-title">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -1162,6 +1150,41 @@ if you know what you are doing.</small></property>
|
|||||||
<property name="top_attach">4</property>
|
<property name="top_attach">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="box17">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkComboBox" id="machine-type">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<signal name="changed" handler="on_machine_type_changed" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="machine-type-label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label">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">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -780,7 +780,8 @@ class vmmDetails(vmmGObjectUI):
|
|||||||
|
|
||||||
show_machine = (arch not in ["i686", "x86_64"] and
|
show_machine = (arch not in ["i686", "x86_64"] and
|
||||||
not self.vm.is_management_domain())
|
not self.vm.is_management_domain())
|
||||||
uiutil.set_grid_row_visible(self.widget("machine-type"), show_machine)
|
uiutil.set_grid_row_visible(self.widget("machine-type-title"),
|
||||||
|
show_machine)
|
||||||
|
|
||||||
if show_machine:
|
if show_machine:
|
||||||
for machine in machines:
|
for machine in machines:
|
||||||
@ -788,6 +789,10 @@ class vmmDetails(vmmGObjectUI):
|
|||||||
continue
|
continue
|
||||||
machtype_model.append([machine])
|
machtype_model.append([machine])
|
||||||
|
|
||||||
|
self.widget("machine-type").set_visible(self.is_customize_dialog)
|
||||||
|
self.widget("machine-type-label").set_visible(
|
||||||
|
not self.is_customize_dialog)
|
||||||
|
|
||||||
# Firmware
|
# Firmware
|
||||||
combo = self.widget("overview-firmware")
|
combo = self.widget("overview-firmware")
|
||||||
model = Gtk.ListStore(str, str, bool)
|
model = Gtk.ListStore(str, str, bool)
|
||||||
@ -2405,10 +2410,13 @@ class vmmDetails(vmmGObjectUI):
|
|||||||
|
|
||||||
# Machine settings
|
# Machine settings
|
||||||
machtype = self.vm.get_machtype()
|
machtype = self.vm.get_machtype()
|
||||||
if arch not in ["i686", "x86_64"]:
|
if self.widget("machine-type").is_visible():
|
||||||
if machtype is not None:
|
uiutil.set_combo_entry(
|
||||||
uiutil.set_combo_entry(self.widget("machine-type"), machtype)
|
self.widget("machine-type"), machtype)
|
||||||
|
elif self.widget("machine-type-label").is_visible():
|
||||||
|
self.widget("machine-type-label").set_text(machtype)
|
||||||
|
|
||||||
|
# Chipset
|
||||||
chipset = _chipset_label_from_machine(machtype)
|
chipset = _chipset_label_from_machine(machtype)
|
||||||
if self.widget("overview-chipset").is_visible():
|
if self.widget("overview-chipset").is_visible():
|
||||||
uiutil.set_combo_entry(
|
uiutil.set_combo_entry(
|
||||||
|
Reference in New Issue
Block a user