
Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com> --- libxkutil/xmlgen.c | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c index 859cc21..592e67d 100644 --- a/libxkutil/xmlgen.c +++ b/libxkutil/xmlgen.c @@ -692,24 +692,36 @@ static const char *set_net_source(const char *root, } -static const char *bridge_net_to_xml(xmlNodePtr nic, struct net_device *dev, - int domtype) +static const char *bridge_net_to_xml(const char *root, struct net_device *dev, + int domtype, struct others **others) { const char *script = "vif-bridge"; - xmlNodePtr tmp; const char *msg = NULL; + CU_DEBUG("Enter bridge_net_to_xml()"); + /* Scripts only supported on Xen guests see 'libvirt' * commit id 1734cdb99 (since 0.9.10) */ if (domtype == DOMAIN_XENPV || domtype == DOMAIN_XENFV) { - tmp = xmlNewChild(nic, NULL, BAD_CAST "script", NULL); - if (tmp == NULL) { + *others = add_node_to_others(*others, + "script", + NULL, + TYPE_NODE, + root); + + if (*others == NULL) { + CU_DEBUG("add node <script> failed."); return XML_ERROR; } - xmlNewProp(tmp, BAD_CAST "path", BAD_CAST script); + + *others = add_node_to_others(*others, + "path", + script, + TYPE_PROP, + "script"); } - msg = set_net_source(nic, dev, "bridge"); + msg = set_net_source(root, dev, "bridge", others); return msg; } -- 1.7.1