Commit 9d54db9e by Guba Sándor

added cpu topology (default 1 socket and vcpu cores)

moved raw_data to the first row (can overdefine topology now)
parent 9e8a6109
...@@ -91,9 +91,18 @@ class VMInstance: ...@@ -91,9 +91,18 @@ class VMInstance:
attrib={ attrib={
'type': self.vm_type 'type': self.vm_type
}) })
# Building raw data into xml
if self.raw_data:
xml_top.append(ET.fromstring(self.raw_data))
# Basic virtual machine paramaters # Basic virtual machine paramaters
ET.SubElement(xml_top, 'name').text = self.name ET.SubElement(xml_top, 'name').text = self.name
ET.SubElement(xml_top, 'vcpu').text = str(self.vcpu) ET.SubElement(xml_top, 'vcpu').text = str(self.vcpu)
cpu = ET.SubElement(xml_top, 'cpu')
ET.SubElement(cpu, 'topology',
attrib={
'sockets': str(1),
'cores': str(self.vcpu),
'threads': str(1)})
ET.SubElement(xml_top, 'memory').text = str(self.memory_max) ET.SubElement(xml_top, 'memory').text = str(self.memory_max)
ET.SubElement(xml_top, 'currentMemory').text = str(self.memory) ET.SubElement(xml_top, 'currentMemory').text = str(self.memory)
# Cpu tune # Cpu tune
...@@ -143,9 +152,6 @@ class VMInstance: ...@@ -143,9 +152,6 @@ class VMInstance:
features = ET.SubElement(xml_top, 'features') features = ET.SubElement(xml_top, 'features')
if self.acpi: if self.acpi:
ET.SubElement(features, 'acpi') ET.SubElement(features, 'acpi')
# Building raw data into xml
if self.raw_data:
xml_top.append(ET.fromstring(self.raw_data))
# Security label # Security label
ET.SubElement(xml_top, 'seclabel', attrib={ ET.SubElement(xml_top, 'seclabel', attrib={
'type': self.seclabel_type, 'type': self.seclabel_type,
......
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