1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-29 18:50:08 +03:00

F #6111: Add VCPU to VM short xml (#2655)

(cherry picked from commit 78c584661c8c121a6dc0fdef50e14c3dc7b1a207)
This commit is contained in:
Pavel Czerný 2023-06-29 09:58:32 +02:00 committed by Ruben S. Montero
parent ffc0f8ecb1
commit bf36ccf30d
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@
<xs:sequence>
<xs:element name="CPU" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="MEMORY" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="VCPU" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="DISK" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>

View File

@ -2523,12 +2523,13 @@ string& VirtualMachine::to_token(string& text) const
string& VirtualMachine::to_xml_short(string& xml)
{
string disks_xml, user_template_xml, history_xml, nics_xml;
string cpu_tmpl, mem_tmpl;
string cpu_tmpl, mem_tmpl, vcpu_tmpl;
ostringstream oss;
obj_template->get("CPU", cpu_tmpl);
obj_template->get("MEMORY", mem_tmpl);
obj_template->get("VCPU", vcpu_tmpl);
oss << "<VM>"
<< "<ID>" << oid << "</ID>"
@ -2553,6 +2554,7 @@ string& VirtualMachine::to_xml_short(string& xml)
oss << "<TEMPLATE>"
<< "<CPU>" << cpu_tmpl << "</CPU>"
<< "<MEMORY>" << mem_tmpl << "</MEMORY>"
<< "<VCPU>" << vcpu_tmpl << "</VCPU>"
<< disks.to_xml_short(disks_xml)
<< nics.to_xml_short(nics_xml);