Signed-off-by: Xu Wang <gesaint(a)linux.vnet.ibm.com>
---
libxkutil/xmlgen.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c
index 4d5ff28..b17ea51 100644
--- a/libxkutil/xmlgen.c
+++ b/libxkutil/xmlgen.c
@@ -923,10 +923,11 @@ static const char *net_xml(xmlNodePtr root, struct domain *dominfo)
static const char *vcpu_xml(xmlNodePtr root, struct domain *dominfo)
{
struct vcpu_device *vcpu;
- xmlNodePtr tmp;
int ret;
char *string = NULL;
+ CU_DEBUG("Enter vcpu_xml()");
+
if (dominfo->dev_vcpu == NULL)
return NULL;
@@ -936,13 +937,22 @@ static const char *vcpu_xml(xmlNodePtr root, struct domain
*dominfo)
if (ret == -1)
return XML_ERROR;
- tmp = xmlNewChild(root, NULL, BAD_CAST "vcpu", BAD_CAST string);
+ vcpu->others = add_node_to_others(vcpu->others,
+ "vcpu",
+ string,
+ TYPE_NODE,
+ "domain");
+
free(string);
- if (tmp == NULL)
+ if (vcpu->others == NULL) {
return XML_ERROR;
- else
- return NULL;
+ }
+
+ dominfo->others = combine_others(dominfo->others, vcpu->others);
+ vcpu->others = NULL;
+
+ return NULL;
}
#if LIBVIR_VERSION_NUMBER >= 9000
--
1.7.1