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

diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index 046cb62..4bce159 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -2226,11 +2226,21 @@ static char *_lxc_os_xml(const char *root, struct 
domain *domain)
 
 static char *os_xml(xmlNodePtr root, struct domain *domain)
 {
-        xmlNodePtr os;
+        const char *os = "os";
 
-        os = xmlNewChild(root, NULL, BAD_CAST "os", NULL);
-        if (os == NULL)
-                return "Failed to allocate XML memory";
+        CU_DEBUG("Enter os_xml()");
+
+        domain->others = add_node_to_others(domain->others,
+                                            0,
+                                            "os",
+                                            NULL,
+                                            TYPE_NODE,
+                                            0,
+                                            "domain");
+
+        if (domain->others == NULL) {
+                return "add node <os> failed.";
+        }
 
         if (domain->type == DOMAIN_XENPV)
                 return _xenpv_os_xml(os, domain);
-- 
1.7.1

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

Reply via email to