mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 22:15:20 +00:00
virNetworkForwardNatDefParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ab5d2776c9
commit
593140dabd
@ -1321,7 +1321,6 @@ virNetworkForwardNatDefParseXML(const char *networkName,
|
|||||||
g_autofree xmlNodePtr *natPortNodes = NULL;
|
g_autofree xmlNodePtr *natPortNodes = NULL;
|
||||||
g_autofree char *addrStart = NULL;
|
g_autofree char *addrStart = NULL;
|
||||||
g_autofree char *addrEnd = NULL;
|
g_autofree char *addrEnd = NULL;
|
||||||
g_autofree char *ipv6 = NULL;
|
|
||||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||||
|
|
||||||
ctxt->node = node;
|
ctxt->node = node;
|
||||||
@ -1333,18 +1332,9 @@ virNetworkForwardNatDefParseXML(const char *networkName,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ipv6 = virXMLPropString(node, "ipv6");
|
if (virXMLPropTristateBool(node, "ipv6", VIR_XML_PROP_OPTIONAL,
|
||||||
if (ipv6) {
|
&def->natIPv6) < 0)
|
||||||
int natIPv6;
|
|
||||||
if ((natIPv6 = virTristateBoolTypeFromString(ipv6)) <= 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("Invalid ipv6 setting '%s' "
|
|
||||||
"in network '%s' NAT"),
|
|
||||||
ipv6, networkName);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
def->natIPv6 = natIPv6;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* addresses for SNAT */
|
/* addresses for SNAT */
|
||||||
nNatAddrs = virXPathNodeSet("./address", ctxt, &natAddrNodes);
|
nNatAddrs = virXPathNodeSet("./address", ctxt, &natAddrNodes);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user