diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 19d03270ef8d3071c54090d0306ad6fb29960392..79aab6e738c92ca23c4dd00e058ea529cb21cc42 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -309,9 +309,8 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, dhcp = virXPathNode("./dhcp", ctxt); if (dhcp != NULL) { - ret = virInterfaceDefParseDhcp(def, dhcp, ctxt); - if (ret != 0) - return ret; + if (virInterfaceDefParseDhcp(def, dhcp, ctxt) < 0) + return -1; } nIpNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); @@ -332,8 +331,7 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, goto error; ctxt->node = ipNodes[i]; - ret = virInterfaceDefParseIp(ip, ctxt); - if (ret != 0) { + if (virInterfaceDefParseIp(ip, ctxt) < 0) { virInterfaceIpDefFree(ip); goto error; } @@ -365,9 +363,8 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, dhcp = virXPathNode("./dhcp", ctxt); if (dhcp != NULL) { - ret = virInterfaceDefParseDhcp(def, dhcp, ctxt); - if (ret != 0) - return ret; + if (virInterfaceDefParseDhcp(def, dhcp, ctxt) < 0) + return -1; } nIpNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); @@ -388,8 +385,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, goto error; ctxt->node = ipNodes[i]; - ret = virInterfaceDefParseIp(ip, ctxt); - if (ret != 0) { + if (virInterfaceDefParseIp(ip, ctxt) < 0) { virInterfaceIpDefFree(ip); goto error; }