
Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com> --- libxkutil/xmlgen.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c index cbf6a9f..fcd701c 100644 --- a/libxkutil/xmlgen.c +++ b/libxkutil/xmlgen.c @@ -1569,12 +1569,13 @@ static char *_xenfv_os_xml(const char *root, struct domain *domain) return NULL; } -static char *_kvm_os_xml(xmlNodePtr root, struct domain *domain) +static char *_kvm_os_xml(const char *root, struct domain *domain) { struct fv_os_info *os = &domain->os_info.fv; - xmlNodePtr tmp; unsigned ret; + CU_DEBUG("Enter _kvm_os_xml()"); + if (os->type == NULL) os->type = strdup("hvm"); @@ -1584,11 +1585,18 @@ static char *_kvm_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) + domain->others = add_node_to_others(domain->others, + "type", + os->type, + TYPE_NODE, + root); + + if (domain->others == NULL) { + CU_DEBUG("add node <type> failed."); return XML_ERROR; + } - ret = _fv_bootlist_xml(root, os); + ret = _fv_bootlist_xml(root, domain); if (ret == 0) return XML_ERROR; -- 1.7.1