mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
domain: Drop unneeded define_vcpus params
This commit is contained in:
parent
a776a35e92
commit
d9c0363cb5
@ -475,30 +475,23 @@ class vmmDomain(gobject.GObject):
|
|||||||
self.attach_device(diskxml)
|
self.attach_device(diskxml)
|
||||||
|
|
||||||
# VCPU changing
|
# VCPU changing
|
||||||
def define_vcpus(self, vcpus, cpuset=None):
|
def define_vcpus(self, vcpus):
|
||||||
vcpus = int(vcpus)
|
vcpus = int(vcpus)
|
||||||
|
|
||||||
def set_node(doc, ctx, vcpus, cpumask, xpath):
|
def set_node(doc, ctx, vcpus, xpath):
|
||||||
node = ctx.xpathEval(xpath)
|
node = ctx.xpathEval(xpath)
|
||||||
node = (node and node[0] or None)
|
node = (node and node[0] or None)
|
||||||
|
|
||||||
if node:
|
if node:
|
||||||
node.setContent(str(vcpus))
|
node.setContent(str(vcpus))
|
||||||
|
|
||||||
# If cpuset mask is not valid, don't change it
|
|
||||||
# If cpuset mask is None, we don't want to use cpuset
|
|
||||||
if cpumask is None or (cpumask is not None and
|
|
||||||
len(cpumask) == 0):
|
|
||||||
node.unsetProp("cpuset")
|
|
||||||
else:
|
|
||||||
node.setProp("cpuset", cpumask)
|
|
||||||
return doc.serialize()
|
return doc.serialize()
|
||||||
|
|
||||||
def change_vcpu_xml(xml, vcpus, cpuset):
|
def change_vcpu_xml(xml, vcpus):
|
||||||
return util.xml_parse_wrapper(xml, set_node, vcpus, cpuset,
|
return util.xml_parse_wrapper(xml, set_node, vcpus,
|
||||||
"/domain/vcpu[1]")
|
"/domain/vcpu[1]")
|
||||||
|
|
||||||
self.redefine(change_vcpu_xml, vcpus, cpuset)
|
self.redefine(change_vcpu_xml, vcpus)
|
||||||
|
|
||||||
def define_cpuset(self, cpuset):
|
def define_cpuset(self, cpuset):
|
||||||
def set_node(doc, ctx, xpath):
|
def set_node(doc, ctx, xpath):
|
||||||
|
Loading…
Reference in New Issue
Block a user