mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
details: Remove the threads warning for CPUs that don't support it
This is pretty obscure, and if it's problematic then libvirt or qemu should be throwing an error or otherwise reporting it Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
70a5cb7b55
commit
4fd9255f9a
250
ui/details.ui
250
ui/details.ui
@ -1476,169 +1476,105 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment3">
|
||||
<object class="GtkGrid" id="cpu-topology-table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="hbox26">
|
||||
<object class="GtkLabel" id="label59">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="cpu-topology-table">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label59">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Thread_s:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-threads</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label58">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Cor_es:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-cores</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label57">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Socke_ts:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-sockets</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-sockets">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_sockets_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-cores">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment4</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_cores_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-threads">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment5</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_threads_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="cpu-topology-warn-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="image4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label65">
|
||||
<property name="width_request">300</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="label" translatable="yes"><small>Selected CPU model does not support Hyper-Threading</small></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="single_line_mode">True</property>
|
||||
<property name="max_width_chars">32</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Thread_s:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-threads</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label58">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Cor_es:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-cores</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label57">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Socke_ts:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-sockets</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-sockets">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment3</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_sockets_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-cores">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment4</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_cores_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="cpu-threads">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">1</property>
|
||||
<property name="adjustment">adjustment5</property>
|
||||
<property name="value">1</property>
|
||||
<signal name="changed" handler="on_cpu_threads_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -326,19 +326,6 @@ def _chipset_label_from_machine(machine):
|
||||
return "i440FX"
|
||||
|
||||
|
||||
def _warn_cpu_thread_topo(threads, cpu_model):
|
||||
if (threads < 2):
|
||||
return False
|
||||
|
||||
non_ht_cpus = ["athlon", "phenom", "opteron"]
|
||||
|
||||
for cpu in non_ht_cpus:
|
||||
if (cpu in cpu_model.lower()):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def _get_performance_icon_name():
|
||||
# This icon isn't in standard adwaita-icon-theme, so
|
||||
# fallback to system-run if it is missing
|
||||
@ -468,7 +455,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
"on_details_inspection_refresh_clicked": self.inspection_refresh,
|
||||
|
||||
"on_cpu_vcpus_changed": self._config_vcpus_changed_cb,
|
||||
"on_cpu_model_changed": lambda *x: self.config_cpu_model_changed(x),
|
||||
"on_cpu_model_changed": lambda *x: self.enable_apply(x, EDIT_CPU),
|
||||
"on_cpu_copy_host_clicked": self.on_cpu_copy_host_clicked,
|
||||
"on_cpu_secure_toggled": self.on_cpu_secure_toggled,
|
||||
"on_cpu_cores_changed": self.config_cpu_topology_changed,
|
||||
@ -1240,15 +1227,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
def on_cpu_secure_toggled(self, ignore):
|
||||
self.enable_apply(EDIT_CPU)
|
||||
|
||||
def config_cpu_model_changed(self, ignore):
|
||||
# Warn about hyper-threading setting
|
||||
cpu_model = self.get_config_cpu_model()
|
||||
threads = self.widget("cpu-threads").get_value()
|
||||
warn_ht = _warn_cpu_thread_topo(threads, cpu_model)
|
||||
self.widget("cpu-topology-warn-box").set_visible(warn_ht)
|
||||
|
||||
self.enable_apply(EDIT_CPU)
|
||||
|
||||
def config_cpu_topology_changed(self, ignore=None):
|
||||
manual_top = self.widget("cpu-topology-table").is_sensitive()
|
||||
self.widget("cpu-vcpus").set_sensitive(not manual_top)
|
||||
@ -1261,12 +1239,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
if uiutil.spin_get_helper(self.widget("cpu-vcpus")) > total:
|
||||
self.widget("cpu-vcpus").set_value(total)
|
||||
self.widget("cpu-vcpus").set_value(total)
|
||||
|
||||
# Warn about hyper-threading setting
|
||||
cpu_model = self.get_config_cpu_model()
|
||||
warn_ht = _warn_cpu_thread_topo(threads, cpu_model)
|
||||
self.widget("cpu-topology-warn-box").set_visible(warn_ht)
|
||||
|
||||
else:
|
||||
vcpus = uiutil.spin_get_helper(self.widget("cpu-vcpus"))
|
||||
self.widget("cpu-sockets").set_value(vcpus or 1)
|
||||
@ -2049,11 +2021,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
self.widget("cpu-model"),
|
||||
virtinst.DomainCpu.SPECIAL_MODE_HV_DEFAULT, column=2)
|
||||
|
||||
# Warn about hyper-threading setting
|
||||
cpu_model = self.get_config_cpu_model()
|
||||
warn_ht = _warn_cpu_thread_topo(threads, cpu_model)
|
||||
self.widget("cpu-topology-warn-box").set_visible(warn_ht)
|
||||
|
||||
is_host = (cpu.mode == "host-model")
|
||||
self.widget("cpu-copy-host").set_active(bool(is_host))
|
||||
self.on_cpu_copy_host_clicked(self.widget("cpu-copy-host"))
|
||||
|
Loading…
Reference in New Issue
Block a user