[Libvirt-cim] [PATCH V2 45/48] Fix xml generation algorithm in system_to_xml()

Xu Wang cngesaint at gmail.com
Mon Oct 28 02:46:14 UTC 2013


Signed-off-by: Xu Wang <gesaint at linux.vnet.ibm.com>
---
 libxkutil/xmlgen.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index c2ff98b..f8061b1 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -2463,9 +2463,12 @@ char *system_to_xml(struct domain *dominfo)
                 &console_xml,
                 &graphics_xml,
                 &emu_xml,
+                &unknown_xml,
                 NULL
         };
 
+        CU_DEBUG("Enter system_to_xml()");
+
         if ((dominfo->type == DOMAIN_XENPV) || (dominfo->type == DOMAIN_XENFV))
                 domtype = "xen";
         else if (dominfo->type == DOMAIN_KVM)
@@ -2493,6 +2496,9 @@ char *system_to_xml(struct domain *dominfo)
         if (xmlNewProp(root, BAD_CAST "type", BAD_CAST domtype) == NULL)
                 goto out;
 
+        /* Parse all tags into others field of domain and generate xml in
+         * others_to_xml().
+         */
         msg = system_xml(root, dominfo);
         if (msg != NULL)
                 goto out;
@@ -2520,6 +2526,12 @@ char *system_to_xml(struct domain *dominfo)
                 goto out;
 #endif
 
+        dominfo->others = others_to_xml(root, dominfo->others, 0, "domain");
+        if (dominfo->others) {
+                CU_DEBUG("others_to_xml failed.");
+        }
+
+        /* Parse <devices> field. */
         devices = xmlNewChild(root, NULL, BAD_CAST "devices", NULL);
         if (devices == NULL) {
                 msg = XML_ERROR;
-- 
1.7.1




More information about the Libvirt-cim mailing list