
Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com> --- libxkutil/xmlgen.c | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c index bd53118..cbf6a9f 100644 --- a/libxkutil/xmlgen.c +++ b/libxkutil/xmlgen.c @@ -1521,12 +1521,13 @@ static int _fv_bootlist_xml(const char *root, struct domain *domain) return 1; } -static char *_xenfv_os_xml(xmlNodePtr root, struct domain *domain) +static char *_xenfv_os_xml(const char *root, struct domain *domain) { struct fv_os_info *os = &domain->os_info.fv; - xmlNodePtr tmp; unsigned ret; + CU_DEBUG("Enter _xenfv_os_xml()"); + if (os->type == NULL) os->type = strdup("hvm"); @@ -1539,15 +1540,29 @@ static char *_xenfv_os_xml(xmlNodePtr root, struct domain *domain) os->bootlist[0] = strdup("hd"); } - tmp = xmlNewChild(root, NULL, BAD_CAST "type", BAD_CAST os->type); - if (tmp == NULL) - return XML_ERROR; + domain->others = add_node_to_others(domain->others, + "type", + os->type, + TYPE_NODE, + root); - tmp = xmlNewChild(root, NULL, BAD_CAST "loader", BAD_CAST os->loader); - if (tmp == NULL) - return XML_ERROR; + if (domain->others == NULL) { + CU_DEBUG("add node <type> failed."); + return 0; + } - ret = _fv_bootlist_xml(root, os); + domain->others = add_node_to_others(domain->others, + "loader", + os->loader, + TYPE_NODE, + root); + + if (domain->others == NULL) { + CU_DEBUG("add node <loader> failed."); + return 0; + } + + ret = _fv_bootlist_xml(root, domain); if (ret == 0) return XML_ERROR; -- 1.7.1