Commit 494675f9 by Karsa Zoltán István

set 0 to def max

parent 2679abf4
...@@ -103,8 +103,8 @@ class VMInstance: ...@@ -103,8 +103,8 @@ class VMInstance:
xml_top.append(child) xml_top.append(child)
# Basic virtual machine paramaters # Basic virtual machine paramaters
ET.SubElement(xml_top, 'name').text = self.name ET.SubElement(xml_top, 'name').text = self.name
if self.vcpu < self.vcpu_max and self.vcpu_max != 0:
ET.SubElement(xml_top, 'vcpu', attrib={'current': str(self.vcpu)}).text = str(self.vcpu_max) ET.SubElement(xml_top, 'vcpu', attrib={'current': str(self.vcpu)}).text = str(self.vcpu_max)
if self.vcpu < self.vcpu_max:
vcpus = ET.SubElement(xml_top, 'vcpus') vcpus = ET.SubElement(xml_top, 'vcpus')
for i in range(0, self.vcpu): for i in range(0, self.vcpu):
ET.SubElement(vcpus, 'vcpu', ET.SubElement(vcpus, 'vcpu',
...@@ -119,6 +119,7 @@ class VMInstance: ...@@ -119,6 +119,7 @@ class VMInstance:
'enabled': 'no', 'enabled': 'no',
'hotpluggable': 'yes'}) 'hotpluggable': 'yes'})
else: else:
ET.SubElement(xml_top, 'vcpu').text = str(self.vcpu)
cpu = ET.SubElement(xml_top, 'cpu') cpu = ET.SubElement(xml_top, 'cpu')
ET.SubElement(cpu, 'topology', ET.SubElement(cpu, 'topology',
attrib={ attrib={
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment