Signed-off-by: Xu Wang <[email protected]>
---
 libxkutil/xmlgen.c |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index 2f9ab5a..dab4bcd 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -1667,20 +1667,36 @@ static char *os_xml(xmlNodePtr root, struct domain 
*domain)
 
 static char *features_xml(xmlNodePtr root, struct domain *domain)
 {
-        xmlNodePtr features;
+        CU_DEBUG("Enter features_xml()");
 
-        features = xmlNewChild(root, NULL, BAD_CAST "features", NULL);
-        if (features == NULL)
-                return "Failed to allocate XML memory";
+        domain->others = add_node_to_others(domain->others,
+                                            "features",
+                                            NULL,
+                                            TYPE_NODE,
+                                            "domain");
 
-        if (domain->acpi)
-                xmlNewChild(features, NULL, BAD_CAST "acpi", NULL);
+        if (domain->others == NULL) {
+                CU_DEBUG("add node <features> failed.");
+                return XML_ERROR;
+        }
 
-        if (domain->apic)
-                xmlNewChild(features, NULL, BAD_CAST "apic", NULL);
+        domain->others = add_node_to_others(domain->others,
+                                            "acpi",
+                                            NULL,
+                                            TYPE_NODE,
+                                            "features");
+
+        domain->others = add_node_to_others(domain->others,
+                                            "apic",
+                                            NULL,
+                                            TYPE_NODE,
+                                            "features");
 
-        if (domain->pae)
-                xmlNewChild(features, NULL, BAD_CAST "pae", NULL);
+        domain->others = add_node_to_others(domain->others,
+                                            "pae",
+                                            NULL,
+                                            TYPE_NODE,
+                                            "features");
 
         return NULL;
 }
-- 
1.7.1

_______________________________________________
Libvirt-cim mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvirt-cim

Reply via email to