
Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com> --- libxkutil/xmlgen.c | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c index 7678503..046cb62 100644 --- a/libxkutil/xmlgen.c +++ b/libxkutil/xmlgen.c @@ -2186,21 +2186,40 @@ static char *_kvm_os_xml(const char *root, struct domain *domain) return NULL; } -static char *_lxc_os_xml(xmlNodePtr root, struct domain *domain) +static char *_lxc_os_xml(const char *root, struct domain *domain) { struct lxc_os_info *os = &domain->os_info.lxc; - xmlNodePtr tmp; + + CU_DEBUG("Enter _lxc_os_xml()"); if (os->type == NULL) os->type = strdup("exe"); - tmp = xmlNewChild(root, NULL, BAD_CAST "init", BAD_CAST os->init); - if (tmp == NULL) + domain->others = add_node_to_others(domain->others, + 0, + "init", + os->init, + TYPE_NODE, + 0, + root); + + if (domain->others == NULL) { + CU_DEBUG("add node <init> failed."); return XML_ERROR; + } - tmp = xmlNewChild(root, NULL, BAD_CAST "type", BAD_CAST os->type); - if (tmp == NULL) + domain->others = add_node_to_others(domain->others, + 0, + "type", + os->type, + TYPE_NODE, + 0, + root); + + if (domain->others == NULL) { + CU_DEBUG("add node <type> failed."); return XML_ERROR; + } return NULL; } -- 1.7.1