mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-10 12:58:27 +03:00
details: Remove UI for vcpu pinning
This UI exposed the old NUMA allocation policy detailed in the last commit. It's very much sub-optimal, and should be removed. Manual cpuset configuration is also quite uncommon and not really something worth exposing in the UI. It can easily be done from the command line with virt-xml. If people complain, I'd consider adding a checkbox for vcpu placement=auto, or an option to do that by default for new VMs.
This commit is contained in:
parent
0d095e22f7
commit
d32953d8c6
187
ui/details.ui
187
ui/details.ui
@ -2464,192 +2464,7 @@ if you know what you are doing.</small></property>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander" id="expander3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="bottom_padding">12</property>
|
||||
<property name="left_padding">21</property>
|
||||
<property name="right_padding">12</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox10">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkTable" id="table9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label336">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Default p_inning:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">cpu-vcpupin</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment24">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox16">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="cpu-vcpupin">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<signal name="changed" handler="on_cpu_vcpupin_changed" swapped="no"/>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="cpu-vcpupin-atkobject">
|
||||
<property name="AtkObject::accessible-name">Virtual CPU Affinity Select</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="label23">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label"><span size='small'>(ex: 0,1,3-5,7)</span></property>
|
||||
<property name="use_markup">True</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="right_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="cpu-vcpupin-generate">
|
||||
<property name="label" translatable="yes">Generate from host _NUMA configuration</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="on_cpu_vcpupin_generate_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment25">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="cpu-vcpupin-generate-err">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="stock">gtk-dialog-warning</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options">GTK_FILL</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="GtkVBox" id="vbox11">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Pinnin_g</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
@ -54,7 +54,6 @@ EDIT_IDMAP,
|
||||
|
||||
EDIT_VCPUS,
|
||||
EDIT_MAXVCPUS,
|
||||
EDIT_CPUSET,
|
||||
EDIT_CPU,
|
||||
EDIT_TOPOLOGY,
|
||||
|
||||
@ -105,7 +104,7 @@ EDIT_FS,
|
||||
|
||||
EDIT_HOSTDEV_ROMBAR,
|
||||
|
||||
) = range(1, 46)
|
||||
) = range(1, 45)
|
||||
|
||||
|
||||
# Columns in hw list model
|
||||
@ -470,8 +469,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
|
||||
"on_cpu_vcpus_changed": self.config_vcpus_changed,
|
||||
"on_cpu_maxvcpus_changed": self.config_maxvcpus_changed,
|
||||
"on_cpu_vcpupin_changed": lambda *x: self.enable_apply(x, EDIT_CPUSET),
|
||||
"on_cpu_vcpupin_generate_clicked": self.config_vcpupin_generate,
|
||||
"on_cpu_model_changed": lambda *x: self.config_cpu_model_changed(x),
|
||||
"on_cpu_copy_host_clicked": self.on_cpu_copy_host_clicked,
|
||||
"on_cpu_cores_changed": self.config_cpu_topology_changed,
|
||||
@ -910,16 +907,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
summary_col.set_sort_column_id(2)
|
||||
|
||||
|
||||
# VCPU Pinning list
|
||||
generate_cpuset = self.widget("cpu-vcpupin-generate")
|
||||
generate_warn = self.widget("cpu-vcpupin-generate-err")
|
||||
if not self.conn.caps.host.topology:
|
||||
generate_cpuset.set_sensitive(False)
|
||||
generate_warn.show()
|
||||
generate_warn.set_tooltip_text(
|
||||
_("Libvirt did not detect NUMA capabilities."))
|
||||
|
||||
|
||||
# Boot device list
|
||||
boot_list = self.widget("boot-list")
|
||||
# [XML boot type, display name, icon name, enabled, can select]
|
||||
@ -1632,10 +1619,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
ignore, upper = maxadj.get_range()
|
||||
maxadj.set_range(mem, upper)
|
||||
|
||||
def generate_cpuset(self):
|
||||
mem = int(self.vm.get_memory()) / 1024
|
||||
return virtinst.DomainNumatune.generate_cpuset(self.conn.get_backend(),
|
||||
mem)
|
||||
|
||||
# VCPUS
|
||||
def config_get_vcpus(self):
|
||||
@ -1643,16 +1626,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
def config_get_maxvcpus(self):
|
||||
return uiutil.spin_get_helper(self.widget("cpu-maxvcpus"))
|
||||
|
||||
def config_vcpupin_generate(self, ignore):
|
||||
try:
|
||||
pinstr = self.generate_cpuset()
|
||||
except Exception, e:
|
||||
return self.err.val_err(
|
||||
_("Error generating CPU configuration"), e)
|
||||
|
||||
self.widget("cpu-vcpupin").set_text("")
|
||||
self.widget("cpu-vcpupin").set_text(pinstr)
|
||||
|
||||
def config_vcpus_changed(self, src):
|
||||
self.enable_apply(EDIT_VCPUS)
|
||||
|
||||
@ -1973,9 +1946,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
if self.edited(EDIT_MAXVCPUS):
|
||||
kwargs["maxvcpus"] = self.config_get_maxvcpus()
|
||||
|
||||
if self.edited(EDIT_CPUSET):
|
||||
kwargs["cpuset"] = self.get_text("cpu-vcpupin")
|
||||
|
||||
if self.edited(EDIT_CPU):
|
||||
kwargs["model"] = self.get_config_cpu_model()
|
||||
|
||||
|
@ -590,7 +590,7 @@ class vmmDomain(vmmLibvirtObject):
|
||||
self._redefine_xmlobj(xmlobj)
|
||||
|
||||
def define_cpu(self, vcpus=_SENTINEL, maxvcpus=_SENTINEL,
|
||||
cpuset=_SENTINEL, model=_SENTINEL, sockets=_SENTINEL,
|
||||
model=_SENTINEL, sockets=_SENTINEL,
|
||||
cores=_SENTINEL, threads=_SENTINEL):
|
||||
guest = self._make_xmlobj_to_define()
|
||||
|
||||
@ -598,8 +598,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
guest.curvcpus = int(vcpus)
|
||||
if maxvcpus != _SENTINEL:
|
||||
guest.vcpus = int(maxvcpus)
|
||||
if cpuset != _SENTINEL:
|
||||
guest.cpuset = cpuset
|
||||
|
||||
if sockets != _SENTINEL:
|
||||
guest.cpu.sockets = sockets
|
||||
@ -1202,8 +1200,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
def vcpu_max_count(self):
|
||||
return int(self.get_xmlobj().vcpus)
|
||||
|
||||
def vcpu_pinning(self):
|
||||
return self.get_xmlobj().cpuset or ""
|
||||
def get_cpu_config(self):
|
||||
return self.get_xmlobj().cpu
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user