[libvirt] [PATCH] Maintain value of ctxt->node in virInterfaceDefParseDhcp.

This was causing subsequent calls to virXPathxxx() to fail, since ctxt->node was left pointing at the dhcp node, rather than the protocol node. Previously this had gone unnoticed, as the dhcp node was the only thing parsed under ip, if it was there. --- src/conf/interface_conf.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 632f28f..818cff2 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -229,10 +229,12 @@ virInterfaceDefParseBondArpValid(virConnectPtr conn, xmlXPathContextPtr ctxt) { static int virInterfaceDefParseDhcp(virConnectPtr conn, virInterfaceDefPtr def, xmlNodePtr dhcp, xmlXPathContextPtr ctxt) { + xmlNodePtr save; char *tmp; int ret = 0; def->proto.dhcp = 1; + save = ctxt->node; ctxt->node = dhcp; /* Not much to do in the current version */ tmp = virXPathString(conn, "string(./@peerdns)", ctxt); @@ -250,6 +252,7 @@ virInterfaceDefParseDhcp(virConnectPtr conn, virInterfaceDefPtr def, } else def->proto.peerdns = -1; + ctxt->node = save; return(ret); } -- 1.6.2.5

On Mon, Sep 28, 2009 at 06:54:19PM -0400, Laine Stump wrote:
This was causing subsequent calls to virXPathxxx() to fail, since ctxt->node was left pointing at the dhcp node, rather than the protocol node. Previously this had gone unnoticed, as the dhcp node was the only thing parsed under ip, if it was there.
Makes sense, applied, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (2)
-
Daniel Veillard
-
Laine Stump