I'm tired of mistyping this all the time, so let's do it the same all the time (similar to how we changed all "Pci" to "PCI" awhile back). (NB: I've left alone some things in the esx and vbox drivers because I'm unable to compile them and they weren't obviously *not* a part of some API. I also didn't change a couple of variables named, e.g. "somethingIptables", because they were derived from the name of the "iptables" command) --- src/conf/domain_conf.c | 24 +++++----- src/conf/domain_conf.h | 12 ++--- src/conf/interface_conf.c | 38 +++++++-------- src/conf/interface_conf.h | 8 ++-- src/conf/network_conf.c | 80 +++++++++++++++---------------- src/conf/network_conf.h | 20 ++++---- src/conf/networkcommon_conf.c | 6 +-- src/esx/esx_driver.c | 44 ++++++++--------- src/esx/esx_interface_driver.c | 4 +- src/esx/esx_vi.c | 4 +- src/esx/esx_vi.h | 2 +- src/libvirt_private.syms | 10 ++-- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_native.c | 4 +- src/network/bridge_driver.c | 74 ++++++++++++++-------------- src/network/bridge_driver_linux.c | 70 +++++++++++++-------------- src/nwfilter/nwfilter_ebiptables_driver.c | 24 +++++----- src/openvz/openvz_conf.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/util/virsocketaddr.c | 4 +- src/util/virsocketaddr.h | 2 +- src/vbox/vbox_network.c | 8 ++-- src/xenconfig/xen_common.c | 2 +- src/xenconfig/xen_sxpr.c | 4 +- 24 files changed, 225 insertions(+), 225 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8ff836c..e57655e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6104,11 +6104,11 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, return ret; } -static virDomainNetIpDefPtr -virDomainNetIpParseXML(xmlNodePtr node) +static virDomainNetIPDefPtr +virDomainNetIPParseXML(xmlNodePtr node) { /* Parse the prefix in every case */ - virDomainNetIpDefPtr ip = NULL, ret = NULL; + virDomainNetIPDefPtr ip = NULL, ret = NULL; char *prefixStr = NULL; unsigned int prefixValue = 0; char *familyStr = NULL; @@ -6230,7 +6230,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node ATTRIBUTE_UNUSED, if (nipnodes) { size_t i; for (i = 0; i < nipnodes; i++) { - virDomainNetIpDefPtr ip = virDomainNetIpParseXML(ipnodes[i]); + virDomainNetIPDefPtr ip = virDomainNetIPParseXML(ipnodes[i]); if (!ip) goto error; @@ -8862,12 +8862,12 @@ virDomainActualNetDefParseXML(xmlNodePtr node, int -virDomainNetAppendIpAddress(virDomainNetDefPtr def, +virDomainNetAppendIPAddress(virDomainNetDefPtr def, const char *address, int family, unsigned int prefix) { - virDomainNetIpDefPtr ipDef = NULL; + virDomainNetIPDefPtr ipDef = NULL; if (VIR_ALLOC(ipDef) < 0) return -1; @@ -8939,7 +8939,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, int ret, val; size_t i; size_t nips = 0; - virDomainNetIpDefPtr *ips = NULL; + virDomainNetIPDefPtr *ips = NULL; size_t nroutes = 0; virNetworkRouteDefPtr *routes = NULL; @@ -9039,9 +9039,9 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, ctxt->node = tmpnode; } } else if (xmlStrEqual(cur->name, BAD_CAST "ip")) { - virDomainNetIpDefPtr ip = NULL; + virDomainNetIPDefPtr ip = NULL; - if (!(ip = virDomainNetIpParseXML(cur))) + if (!(ip = virDomainNetIPParseXML(cur))) goto error; if (VIR_APPEND_ELEMENT(ips, nips, ip) < 0) @@ -20239,7 +20239,7 @@ virDomainFSDefFormat(virBufferPtr buf, } static int -virDomainNetIpsFormat(virBufferPtr buf, virDomainNetIpDefPtr *ips, size_t nips) +virDomainNetIPsFormat(virBufferPtr buf, virDomainNetIPDefPtr *ips, size_t nips) { size_t i; @@ -20433,7 +20433,7 @@ virDomainHostdevDefFormatCaps(virBufferPtr buf, virBufferAddLit(buf, "</source>\n"); if (def->source.caps.type == VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET) { - if (virDomainNetIpsFormat(buf, def->source.caps.u.net.ips, + if (virDomainNetIPsFormat(buf, def->source.caps.u.net.ips, def->source.caps.u.net.nips) < 0) return -1; if (virDomainNetRoutesFormat(buf, def->source.caps.u.net.routes, @@ -20852,7 +20852,7 @@ virDomainNetDefFormat(virBufferPtr buf, return -1; } - if (virDomainNetIpsFormat(buf, def->ips, def->nips) < 0) + if (virDomainNetIPsFormat(buf, def->ips, def->nips) < 0) return -1; if (virDomainNetRoutesFormat(buf, def->routes, def->nroutes) < 0) return -1; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6e81e52..8529a78 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -382,9 +382,9 @@ typedef enum { VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST } virDomainHostdevCapsType; -typedef struct _virDomainNetIpDef virDomainNetIpDef; -typedef virDomainNetIpDef *virDomainNetIpDefPtr; -struct _virDomainNetIpDef { +typedef struct _virDomainNetIPDef virDomainNetIPDef; +typedef virDomainNetIPDef *virDomainNetIPDefPtr; +struct _virDomainNetIPDef { virSocketAddr address; /* ipv4 or ipv6 address */ unsigned int prefix; /* number of 1 bits in the net mask */ }; @@ -403,7 +403,7 @@ struct _virDomainHostdevCaps { struct { char *iface; size_t nips; - virDomainNetIpDefPtr *ips; + virDomainNetIPDefPtr *ips; size_t nroutes; virNetworkRouteDefPtr *routes; } net; @@ -986,7 +986,7 @@ struct _virDomainNetDef { int trustGuestRxFilters; /* enum virTristateBool */ int linkstate; size_t nips; - virDomainNetIpDefPtr *ips; + virDomainNetIPDefPtr *ips; size_t nroutes; virNetworkRouteDefPtr *routes; }; @@ -2775,7 +2775,7 @@ virNetDevBandwidthPtr virDomainNetGetActualBandwidth(virDomainNetDefPtr iface); virNetDevVlanPtr virDomainNetGetActualVlan(virDomainNetDefPtr iface); bool virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface); -int virDomainNetAppendIpAddress(virDomainNetDefPtr def, +int virDomainNetAppendIPAddress(virDomainNetDefPtr def, const char *address, int family, unsigned int prefix); diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 26e55cc..40f1958 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -45,7 +45,7 @@ virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def, virInterfaceType parentIfType); static -void virInterfaceIpDefFree(virInterfaceIpDefPtr def) +void virInterfaceIPDefFree(virInterfaceIPDefPtr def) { if (def == NULL) return; @@ -61,7 +61,7 @@ void virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) if (def == NULL) return; for (i = 0; i < def->nips; i++) - virInterfaceIpDefFree(def->ips[i]); + virInterfaceIPDefFree(def->ips[i]); VIR_FREE(def->ips); VIR_FREE(def->family); VIR_FREE(def->gateway); @@ -281,7 +281,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, } static int -virInterfaceDefParseIp(virInterfaceIpDefPtr def, +virInterfaceDefParseIP(virInterfaceIPDefPtr def, xmlXPathContextPtr ctxt) { int ret = 0; @@ -310,7 +310,7 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, { xmlNodePtr dhcp; xmlNodePtr *ipNodes = NULL; - int nIpNodes, ret = -1; + int nIPNodes, ret = -1; size_t i; char *tmp; @@ -323,26 +323,26 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, return -1; } - nIpNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); - if (nIpNodes < 0) + nIPNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); + if (nIPNodes < 0) return -1; if (ipNodes == NULL) return 0; - if (VIR_ALLOC_N(def->ips, nIpNodes) < 0) + if (VIR_ALLOC_N(def->ips, nIPNodes) < 0) goto error; def->nips = 0; - for (i = 0; i < nIpNodes; i++) { + for (i = 0; i < nIPNodes; i++) { - virInterfaceIpDefPtr ip; + virInterfaceIPDefPtr ip; if (VIR_ALLOC(ip) < 0) goto error; ctxt->node = ipNodes[i]; - if (virInterfaceDefParseIp(ip, ctxt) < 0) { - virInterfaceIpDefFree(ip); + if (virInterfaceDefParseIP(ip, ctxt) < 0) { + virInterfaceIPDefFree(ip); goto error; } def->ips[def->nips++] = ip; @@ -361,7 +361,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, { xmlNodePtr dhcp, autoconf; xmlNodePtr *ipNodes = NULL; - int nIpNodes, ret = -1; + int nIPNodes, ret = -1; size_t i; char *tmp; @@ -378,26 +378,26 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, return -1; } - nIpNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); - if (nIpNodes < 0) + nIPNodes = virXPathNodeSet("./ip", ctxt, &ipNodes); + if (nIPNodes < 0) return -1; if (ipNodes == NULL) return 0; - if (VIR_ALLOC_N(def->ips, nIpNodes) < 0) + if (VIR_ALLOC_N(def->ips, nIPNodes) < 0) goto error; def->nips = 0; - for (i = 0; i < nIpNodes; i++) { + for (i = 0; i < nIPNodes; i++) { - virInterfaceIpDefPtr ip; + virInterfaceIPDefPtr ip; if (VIR_ALLOC(ip) < 0) goto error; ctxt->node = ipNodes[i]; - if (virInterfaceDefParseIp(ip, ctxt) < 0) { - virInterfaceIpDefFree(ip); + if (virInterfaceDefParseIP(ip, ctxt) < 0) { + virInterfaceIPDefFree(ip); goto error; } def->ips[def->nips++] = ip; diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h index 5cabec7..2523207 100644 --- a/src/conf/interface_conf.h +++ b/src/conf/interface_conf.h @@ -119,9 +119,9 @@ struct _virInterfaceVlanDef { char *dev_name; /* device name for vlan */ }; -typedef struct _virInterfaceIpDef virInterfaceIpDef; -typedef virInterfaceIpDef *virInterfaceIpDefPtr; -struct _virInterfaceIpDef { +typedef struct _virInterfaceIPDef virInterfaceIPDef; +typedef virInterfaceIPDef *virInterfaceIPDefPtr; +struct _virInterfaceIPDef { char *address; /* ip address */ int prefix; /* ip prefix */ }; @@ -135,7 +135,7 @@ struct _virInterfaceProtocolDef { int peerdns; /* dhcp peerdns ? */ int autoconf; /* only useful if family is ipv6 */ int nips; - virInterfaceIpDefPtr *ips; /* ptr to array of ips[nips] */ + virInterfaceIPDefPtr *ips; /* ptr to array of ips[nips] */ char *gateway; /* route gateway */ }; diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 02b8cd7..5ae2bdf 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -310,7 +310,7 @@ virNetworkDHCPHostDefClear(virNetworkDHCPHostDefPtr def) } static void -virNetworkIpDefClear(virNetworkIpDefPtr def) +virNetworkIPDefClear(virNetworkIPDefPtr def) { VIR_FREE(def->family); VIR_FREE(def->ranges); @@ -402,7 +402,7 @@ virNetworkDefFree(virNetworkDefPtr def) virNetworkForwardDefClear(&def->forward); for (i = 0; i < def->nips && def->ips; i++) - virNetworkIpDefClear(&def->ips[i]); + virNetworkIPDefClear(&def->ips[i]); VIR_FREE(def->ips); for (i = 0; i < def->nroutes && def->routes; i++) @@ -780,8 +780,8 @@ void virNetworkRemoveInactive(virNetworkObjListPtr nets, } /* return ips[index], or NULL if there aren't enough ips */ -virNetworkIpDefPtr -virNetworkDefGetIpByIndex(const virNetworkDef *def, +virNetworkIPDefPtr +virNetworkDefGetIPByIndex(const virNetworkDef *def, int family, size_t n) { size_t i; @@ -832,9 +832,9 @@ virNetworkDefGetRouteByIndex(const virNetworkDef *def, /* return number of 1 bits in netmask for the network's ipAddress, * or -1 on error */ -int virNetworkIpDefPrefix(const virNetworkIpDef *def) +int virNetworkIPDefPrefix(const virNetworkIPDef *def) { - return virSocketAddrGetIpPrefix(&def->address, + return virSocketAddrGetIPPrefix(&def->address, &def->netmask, def->prefix); } @@ -843,7 +843,7 @@ int virNetworkIpDefPrefix(const virNetworkIpDef *def) * definition, based on either the definition's netmask, or its * prefix. Return -1 on error (and set the netmask family to AF_UNSPEC) */ -int virNetworkIpDefNetmask(const virNetworkIpDef *def, +int virNetworkIPDefNetmask(const virNetworkIPDef *def, virSocketAddrPtr netmask) { if (VIR_SOCKET_ADDR_IS_FAMILY(&def->netmask, AF_INET)) { @@ -851,14 +851,14 @@ int virNetworkIpDefNetmask(const virNetworkIpDef *def, return 0; } - return virSocketAddrPrefixToNetmask(virNetworkIpDefPrefix(def), netmask, + return virSocketAddrPrefixToNetmask(virNetworkIPDefPrefix(def), netmask, VIR_SOCKET_ADDR_FAMILY(&def->address)); } static int virSocketAddrRangeParseXML(const char *networkName, - virNetworkIpDefPtr ipdef, + virNetworkIPDefPtr ipdef, xmlNodePtr node, virSocketAddrRangePtr range) { @@ -887,7 +887,7 @@ virSocketAddrRangeParseXML(const char *networkName, /* do a sanity check of the range */ if (virSocketAddrGetRange(&range->start, &range->end, &ipdef->address, - virNetworkIpDefPrefix(ipdef)) < 0) + virNetworkIPDefPrefix(ipdef)) < 0) goto cleanup; ret = 0; @@ -900,7 +900,7 @@ virSocketAddrRangeParseXML(const char *networkName, static int virNetworkDHCPHostDefParseXML(const char *networkName, - virNetworkIpDefPtr def, + virNetworkIPDefPtr def, xmlNodePtr node, virNetworkDHCPHostDefPtr host, bool partialOkay) @@ -1021,7 +1021,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName, static int virNetworkDHCPDefParseXML(const char *networkName, xmlNodePtr node, - virNetworkIpDefPtr def) + virNetworkIPDefPtr def) { int ret = -1; xmlNodePtr cur; @@ -1448,10 +1448,10 @@ static int virNetworkIPDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkIpDefPtr def) + virNetworkIPDefPtr def) { /* - * virNetworkIpDef object is already allocated as part of an array. + * virNetworkIPDef object is already allocated as part of an array. * On failure clear it out, but don't free it. */ @@ -1586,7 +1586,7 @@ virNetworkIPDefParseXML(const char *networkName, cleanup: if (result < 0) - virNetworkIpDefClear(def); + virNetworkIPDefClear(def); VIR_FREE(address); VIR_FREE(netmask); @@ -2050,7 +2050,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) xmlNodePtr *ipNodes = NULL; xmlNodePtr *routeNodes = NULL; xmlNodePtr *portGroupNodes = NULL; - int nIps, nPortGroups, nRoutes; + int nips, nPortGroups, nRoutes; xmlNodePtr dnsNode = NULL; xmlNodePtr virtPortNode = NULL; xmlNodePtr forwardNode = NULL; @@ -2227,18 +2227,18 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) } VIR_FREE(portGroupNodes); - nIps = virXPathNodeSet("./ip", ctxt, &ipNodes); - if (nIps < 0) + nips = virXPathNodeSet("./ip", ctxt, &ipNodes); + if (nips < 0) goto error; - if (nIps > 0) { + if (nips > 0) { size_t i; /* allocate array to hold all the addrs */ - if (VIR_ALLOC_N(def->ips, nIps) < 0) + if (VIR_ALLOC_N(def->ips, nips) < 0) goto error; /* parse each addr */ - for (i = 0; i < nIps; i++) { + for (i = 0; i < nips; i++) { if (virNetworkIPDefParseXML(def->name, ipNodes[i], ctxt, @@ -2278,7 +2278,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) * is directly reachable from this bridge. */ nRoutes = def->nroutes; - nIps = def->nips; + nips = def->nips; for (i = 0; i < nRoutes; i++) { size_t j; virSocketAddr testAddr, testGw; @@ -2286,13 +2286,13 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt) virNetworkRouteDefPtr gwdef = def->routes[i]; virSocketAddrPtr gateway = virNetworkRouteDefGetGateway(gwdef); addrMatch = false; - for (j = 0; j < nIps; j++) { - virNetworkIpDefPtr def2 = &def->ips[j]; + for (j = 0; j < nips; j++) { + virNetworkIPDefPtr def2 = &def->ips[j]; if (VIR_SOCKET_ADDR_FAMILY(gateway) != VIR_SOCKET_ADDR_FAMILY(&def2->address)) { continue; } - int prefix = virNetworkIpDefPrefix(def2); + int prefix = virNetworkIPDefPrefix(def2); virSocketAddrMaskByPrefix(&def2->address, prefix, &testAddr); virSocketAddrMaskByPrefix(gateway, prefix, &testGw); if (VIR_SOCKET_ADDR_VALID(&testAddr) && @@ -2544,8 +2544,8 @@ virNetworkDNSDefFormat(virBufferPtr buf, } static int -virNetworkIpDefFormat(virBufferPtr buf, - const virNetworkIpDef *def) +virNetworkIPDefFormat(virBufferPtr buf, + const virNetworkIPDef *def) { int result = -1; @@ -2871,7 +2871,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, goto error; for (i = 0; i < def->nips; i++) { - if (virNetworkIpDefFormat(buf, &def->ips[i]) < 0) + if (virNetworkIPDefFormat(buf, &def->ips[i]) < 0) goto error; } @@ -3467,15 +3467,15 @@ virNetworkDefUpdateIP(virNetworkDefPtr def, return -1; } -static virNetworkIpDefPtr -virNetworkIpDefByIndex(virNetworkDefPtr def, int parentIndex) +static virNetworkIPDefPtr +virNetworkIPDefByIndex(virNetworkDefPtr def, int parentIndex) { - virNetworkIpDefPtr ipdef = NULL; + virNetworkIPDefPtr ipdef = NULL; size_t i; /* first find which ip element's dhcp host list to work on */ if (parentIndex >= 0) { - ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, parentIndex); + ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, parentIndex); if (!(ipdef)) { virReportError(VIR_ERR_OPERATION_INVALID, _("couldn't update dhcp host entry - no <ip> " @@ -3489,15 +3489,15 @@ virNetworkIpDefByIndex(virNetworkDefPtr def, int parentIndex) * means the one and only <ip> that has <dhcp> element */ for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i)); i++) { if (ipdef->nranges || ipdef->nhosts) break; } if (!ipdef) { - ipdef = virNetworkDefGetIpByIndex(def, AF_INET, 0); + ipdef = virNetworkDefGetIPByIndex(def, AF_INET, 0); if (!ipdef) - ipdef = virNetworkDefGetIpByIndex(def, AF_INET6, 0); + ipdef = virNetworkDefGetIPByIndex(def, AF_INET6, 0); } if (!ipdef) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -3510,13 +3510,13 @@ virNetworkIpDefByIndex(virNetworkDefPtr def, int parentIndex) static int virNetworkDefUpdateCheckMultiDHCP(virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { int family = VIR_SOCKET_ADDR_FAMILY(&ipdef->address); size_t i; - virNetworkIpDefPtr ip; + virNetworkIPDefPtr ip; - for (i = 0; (ip = virNetworkDefGetIpByIndex(def, family, i)); i++) { + for (i = 0; (ip = virNetworkDefGetIPByIndex(def, family, i)); i++) { if (ip != ipdef) { if (ip->nranges || ip->nhosts) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -3541,7 +3541,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def, { size_t i; int ret = -1; - virNetworkIpDefPtr ipdef = virNetworkIpDefByIndex(def, parentIndex); + virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex); virNetworkDHCPHostDef host; bool partialOkay = (command == VIR_NETWORK_UPDATE_COMMAND_DELETE); @@ -3680,7 +3680,7 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def, { size_t i; int ret = -1; - virNetworkIpDefPtr ipdef = virNetworkIpDefByIndex(def, parentIndex); + virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex); virSocketAddrRange range; memset(&range, 0, sizeof(range)); diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 0d34dfe..18f4d1e 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -1,7 +1,7 @@ /* * network_conf.h: network XML handling * - * Copyright (C) 2006-2015 Red Hat, Inc. + * Copyright (C) 2006-2016 Red Hat, Inc. * Copyright (C) 2006-2008 Daniel P. Berrange * * This library is free software; you can redistribute it and/or @@ -138,15 +138,15 @@ struct _virNetworkDNSDef { char **forwarders; }; -typedef struct _virNetworkIpDef virNetworkIpDef; -typedef virNetworkIpDef *virNetworkIpDefPtr; -struct _virNetworkIpDef { +typedef struct _virNetworkIPDef virNetworkIPDef; +typedef virNetworkIPDef *virNetworkIPDefPtr; +struct _virNetworkIPDef { char *family; /* ipv4 or ipv6 - default is ipv4 */ virSocketAddr address; /* Bridge IP address */ /* One or the other of the following two will be used for a given * IP address, but never both. The parser guarantees this. - * Use virNetworkIpDefPrefix/virNetworkIpDefNetmask rather + * Use virNetworkIPDefPrefix/virNetworkIPDefNetmask rather * than accessing the data directly - these utility functions * will convert one into the other as necessary. */ @@ -240,7 +240,7 @@ struct _virNetworkDef { virNetworkForwardDef forward; size_t nips; - virNetworkIpDefPtr ips; /* ptr to array of IP addresses on this network */ + virNetworkIPDefPtr ips; /* ptr to array of IP addresses on this network */ size_t nroutes; virNetworkRouteDefPtr *routes; /* ptr to array of static routes on this interface */ @@ -351,14 +351,14 @@ const char * virNetworkDefForwardIf(const virNetworkDef *def, size_t n); virPortGroupDefPtr virPortGroupFindByName(virNetworkDefPtr net, const char *portgroup); -virNetworkIpDefPtr -virNetworkDefGetIpByIndex(const virNetworkDef *def, +virNetworkIPDefPtr +virNetworkDefGetIPByIndex(const virNetworkDef *def, int family, size_t n); virNetworkRouteDefPtr virNetworkDefGetRouteByIndex(const virNetworkDef *def, int family, size_t n); -int virNetworkIpDefPrefix(const virNetworkIpDef *def); -int virNetworkIpDefNetmask(const virNetworkIpDef *def, +int virNetworkIPDefPrefix(const virNetworkIPDef *def); +int virNetworkIPDefNetmask(const virNetworkIPDef *def, virSocketAddrPtr netmask); int virNetworkSaveXML(const char *configDir, diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index 7b7a851..8f9d4b8 100644 --- a/src/conf/networkcommon_conf.c +++ b/src/conf/networkcommon_conf.c @@ -38,7 +38,7 @@ struct _virNetworkRouteDef { /* One or the other of the following two will be used for a given * Network address, but never both. The parser guarantees this. - * The virSocketAddrGetIpPrefix() can be used to get a + * The virSocketAddrGetIPPrefix() can be used to get a * valid prefix. */ virSocketAddr netmask; /* ipv4 - either netmask or prefix specified */ @@ -387,10 +387,10 @@ virNetworkRouteDefGetPrefix(virNetworkRouteDefPtr def) virSocketAddrEqual(&def->netmask, &zero))) prefix = 0; else - prefix = virSocketAddrGetIpPrefix(&def->address, &def->netmask, + prefix = virSocketAddrGetIPPrefix(&def->address, &def->netmask, def->prefix); } else { - prefix = virSocketAddrGetIpPrefix(&def->address, &def->netmask, + prefix = virSocketAddrGetIPPrefix(&def->address, &def->netmask, def->prefix); } diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 60fcac0..eae015a 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -612,7 +612,7 @@ static int esxConnectToHost(esxPrivate *priv, virConnectPtr conn, virConnectAuthPtr auth, - char **vCenterIpAddress) + char **vCenterIPAddress) { int result = -1; char ipAddress[NI_MAXHOST] = ""; @@ -626,7 +626,7 @@ esxConnectToHost(esxPrivate *priv, ? esxVI_ProductLine_ESX : esxVI_ProductLine_GSX; - if (!vCenterIpAddress || *vCenterIpAddress) { + if (!vCenterIPAddress || *vCenterIPAddress) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); return -1; } @@ -683,7 +683,7 @@ esxConnectToHost(esxPrivate *priv, &inMaintenanceMode, esxVI_Occurrence_RequiredItem) < 0 || esxVI_GetStringValue(hostSystem, "summary.managementServerIp", - vCenterIpAddress, + vCenterIPAddress, esxVI_Occurrence_OptionalItem) < 0) { goto cleanup; } @@ -692,7 +692,7 @@ esxConnectToHost(esxPrivate *priv, if (inMaintenanceMode == esxVI_Boolean_True) VIR_WARN("The server is in maintenance mode"); - if (VIR_STRDUP(*vCenterIpAddress, *vCenterIpAddress) < 0) + if (VIR_STRDUP(*vCenterIPAddress, *vCenterIPAddress) < 0) goto cleanup; result = 0; @@ -714,7 +714,7 @@ esxConnectToVCenter(esxPrivate *priv, virConnectPtr conn, virConnectAuthPtr auth, const char *hostname, - const char *hostSystemIpAddress) + const char *hostSystemIPAddress) { int result = -1; char ipAddress[NI_MAXHOST] = ""; @@ -722,7 +722,7 @@ esxConnectToVCenter(esxPrivate *priv, char *password = NULL; char *url = NULL; - if (!hostSystemIpAddress && + if (!hostSystemIPAddress && (!priv->parsedUri->path || STREQ(priv->parsedUri->path, "/"))) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Path has to specify the datacenter and compute resource")); @@ -770,9 +770,9 @@ esxConnectToVCenter(esxPrivate *priv, goto cleanup; } - if (hostSystemIpAddress) { + if (hostSystemIPAddress) { if (esxVI_Context_LookupManagedObjectsByHostSystemIp - (priv->vCenter, hostSystemIpAddress) < 0) { + (priv->vCenter, hostSystemIPAddress) < 0) { goto cleanup; } } else { @@ -847,8 +847,8 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, virDrvOpenStatus result = VIR_DRV_OPEN_ERROR; char *plus; esxPrivate *priv = NULL; - char *potentialVCenterIpAddress = NULL; - char vCenterIpAddress[NI_MAXHOST] = ""; + char *potentialVCenterIPAddress = NULL; + char vCenterIPAddress[NI_MAXHOST] = ""; virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -939,46 +939,46 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, STRCASEEQ(conn->uri->scheme, "gsx")) { /* Connect to host */ if (esxConnectToHost(priv, conn, auth, - &potentialVCenterIpAddress) < 0) { + &potentialVCenterIPAddress) < 0) { goto cleanup; } /* Connect to vCenter */ if (priv->parsedUri->vCenter) { if (STREQ(priv->parsedUri->vCenter, "*")) { - if (!potentialVCenterIpAddress) { + if (!potentialVCenterIPAddress) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("This host is not managed by a vCenter")); goto cleanup; } - if (!virStrcpyStatic(vCenterIpAddress, - potentialVCenterIpAddress)) { + if (!virStrcpyStatic(vCenterIPAddress, + potentialVCenterIPAddress)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("vCenter IP address %s too big for destination"), - potentialVCenterIpAddress); + potentialVCenterIPAddress); goto cleanup; } } else { if (esxUtil_ResolveHostname(priv->parsedUri->vCenter, - vCenterIpAddress, NI_MAXHOST) < 0) { + vCenterIPAddress, NI_MAXHOST) < 0) { goto cleanup; } - if (potentialVCenterIpAddress && - STRNEQ(vCenterIpAddress, potentialVCenterIpAddress)) { + if (potentialVCenterIPAddress && + STRNEQ(vCenterIPAddress, potentialVCenterIPAddress)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("This host is managed by a vCenter with IP " "address %s, but a mismachting vCenter '%s' " "(%s) has been specified"), - potentialVCenterIpAddress, priv->parsedUri->vCenter, - vCenterIpAddress); + potentialVCenterIPAddress, priv->parsedUri->vCenter, + vCenterIPAddress); goto cleanup; } } if (esxConnectToVCenter(priv, conn, auth, - vCenterIpAddress, + vCenterIPAddress, priv->host->ipAddress) < 0) { goto cleanup; } @@ -1011,7 +1011,7 @@ esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, cleanup: esxFreePrivate(&priv); - VIR_FREE(potentialVCenterIpAddress); + VIR_FREE(potentialVCenterIPAddress); return result; } diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c index 58096e8..e3b4116 100644 --- a/src/esx/esx_interface_driver.c +++ b/src/esx/esx_interface_driver.c @@ -181,8 +181,8 @@ esxInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags) virInterfaceProtocolDefPtr protocols; virInterfaceProtocolDef protocol; virSocketAddr socketAddress; - virInterfaceIpDefPtr ips; - virInterfaceIpDef ip; + virInterfaceIPDefPtr ips; + virInterfaceIPDef ip; virCheckFlags(VIR_INTERFACE_XML_INACTIVE, NULL); diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index bbf3721..a28ac7b 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -1367,13 +1367,13 @@ esxVI_Context_LookupManagedObjectsByPath(esxVI_Context *ctx, const char *path) int esxVI_Context_LookupManagedObjectsByHostSystemIp(esxVI_Context *ctx, - const char *hostSystemIpAddress) + const char *hostSystemIPAddress) { int result = -1; esxVI_ManagedObjectReference *managedObjectReference = NULL; /* Lookup HostSystem */ - if (esxVI_FindByIp(ctx, NULL, hostSystemIpAddress, esxVI_Boolean_False, + if (esxVI_FindByIp(ctx, NULL, hostSystemIPAddress, esxVI_Boolean_False, &managedObjectReference) < 0 || esxVI_LookupHostSystem(ctx, NULL, managedObjectReference, NULL, &ctx->hostSystem, diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index c41541e..7c53f37 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -220,7 +220,7 @@ int esxVI_Context_Connect(esxVI_Context *ctx, const char *ipAddress, int esxVI_Context_LookupManagedObjects(esxVI_Context *ctx); int esxVI_Context_LookupManagedObjectsByPath(esxVI_Context *ctx, const char *path); int esxVI_Context_LookupManagedObjectsByHostSystemIp(esxVI_Context *ctx, - const char *hostSystemIpAddress); + const char *hostSystemIPAddress); int esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName, const char *request, esxVI_Response **response, esxVI_Occurrence occurrence); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index df2dfc3..36e3901 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -371,7 +371,7 @@ virDomainMemoryFindByDef; virDomainMemoryFindInactiveByDef; virDomainMemoryInsert; virDomainMemoryRemove; -virDomainNetAppendIpAddress; +virDomainNetAppendIPAddress; virDomainNetDefFormat; virDomainNetDefFree; virDomainNetFind; @@ -597,7 +597,7 @@ virNetworkDefFormat; virNetworkDefFormatBuf; virNetworkDefForwardIf; virNetworkDefFree; -virNetworkDefGetIpByIndex; +virNetworkDefGetIPByIndex; virNetworkDefGetRouteByIndex; virNetworkDefParseFile; virNetworkDefParseNode; @@ -605,8 +605,8 @@ virNetworkDefParseString; virNetworkDefUpdateSection; virNetworkDeleteConfig; virNetworkForwardTypeToString; -virNetworkIpDefNetmask; -virNetworkIpDefPrefix; +virNetworkIPDefNetmask; +virNetworkIPDefPrefix; virNetworkLoadAllConfigs; virNetworkLoadAllState; virNetworkObjAssignDef; @@ -2245,7 +2245,7 @@ virSocketAddrCheckNetmask; virSocketAddrEqual; virSocketAddrFormat; virSocketAddrFormatFull; -virSocketAddrGetIpPrefix; +virSocketAddrGetIPPrefix; virSocketAddrGetPort; virSocketAddrGetRange; virSocketAddrIsNetmask; diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 33dcfec..531bbd5 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -513,7 +513,7 @@ static int lxcContainerRenameAndEnableInterfaces(virDomainDefPtr vmDef, goto error_out; for (j = 0; j < netDef->nips; j++) { - virDomainNetIpDefPtr ip = netDef->ips[j]; + virDomainNetIPDefPtr ip = netDef->ips[j]; unsigned int prefix = (ip->prefix > 0) ? ip->prefix : VIR_SOCKET_ADDR_DEFAULT_PREFIX; char *ipStr = virSocketAddrFormat(&ip->address); diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index 7f8e904..9ad1b08 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -419,7 +419,7 @@ typedef struct { char *macvlanmode; char *vlanid; char *name; - virDomainNetIpDefPtr *ips; + virDomainNetIPDefPtr *ips; size_t nips; char *gateway_ipv4; char *gateway_ipv6; @@ -601,7 +601,7 @@ lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) STREQ(name, "lxc.network.ipv6")) { int family = AF_INET; char **ipparts = NULL; - virDomainNetIpDefPtr ip = NULL; + virDomainNetIPDefPtr ip = NULL; if (VIR_ALLOC(ip) < 0) return -1; diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 7c8d2cc..130b77d 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -872,7 +872,7 @@ networkKillDaemon(pid_t pid, const char *daemonName, const char *networkName) static int networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { size_t i; bool ipv6 = false; @@ -923,7 +923,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, int nbleases = 0; size_t i; virNetworkDNSDefPtr dns = &network->def->dns; - virNetworkIpDefPtr tmpipdef, ipdef, ipv4def, ipv6def; + virNetworkIPDefPtr tmpipdef, ipdef, ipv4def, ipv6def; bool ipv6SLAAC; char *saddr = NULL, *eaddr = NULL; @@ -1013,7 +1013,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, * So listen on all defined IPv[46] addresses */ for (i = 0; - (tmpipdef = virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, i)); + (tmpipdef = virNetworkDefGetIPByIndex(network->def, AF_UNSPEC, i)); i++) { char *ipaddr = virSocketAddrFormat(&tmpipdef->address); @@ -1123,7 +1123,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, /* Find the first dhcp for both IPv4 and IPv6 */ for (i = 0, ipv4def = NULL, ipv6def = NULL, ipv6SLAAC = false; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_UNSPEC, i)); i++) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) { if (ipdef->nranges || ipdef->nhosts) { @@ -1181,7 +1181,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, while (ipdef) { int prefix; - prefix = virNetworkIpDefPrefix(ipdef); + prefix = virNetworkIPDefPrefix(ipdef); if (prefix < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("bridge '%s' has an invalid prefix"), @@ -1206,7 +1206,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, thisRange = virSocketAddrGetRange(&ipdef->ranges[r].start, &ipdef->ranges[r].end, &ipdef->address, - virNetworkIpDefPrefix(ipdef)); + virNetworkIPDefPrefix(ipdef)); if (thisRange < 0) goto cleanup; nbleases += thisRange; @@ -1287,7 +1287,7 @@ networkDnsmasqConfContents(virNetworkObjPtr network, virBufferAddLit(&configbuf, "enable-ra\n"); } else { for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET6, i)); i++) { if (!(ipdef->nranges || ipdef->nhosts)) { char *bridgeaddr = virSocketAddrFormat(&ipdef->address); @@ -1380,7 +1380,7 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr driver, int ret = -1; dnsmasqContext *dctx = NULL; - if (!virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, 0)) { + if (!virNetworkDefGetIPByIndex(network->def, AF_UNSPEC, 0)) { /* no IP addresses, so we don't need to run */ ret = 0; goto cleanup; @@ -1457,11 +1457,11 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver, { int ret = -1; size_t i; - virNetworkIpDefPtr ipdef, ipv4def, ipv6def; + virNetworkIPDefPtr ipdef, ipv4def, ipv6def; dnsmasqContext *dctx = NULL; /* if no IP addresses specified, nothing to do */ - if (!virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, 0)) + if (!virNetworkDefGetIPByIndex(network->def, AF_UNSPEC, 0)) return 0; /* if there's no running dnsmasq, just start it */ @@ -1480,7 +1480,7 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver, */ ipv4def = NULL; for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET, i)); i++) { if (!ipv4def && (ipdef->nranges || ipdef->nhosts)) ipv4def = ipdef; @@ -1488,7 +1488,7 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver, ipv6def = NULL; for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET6, i)); i++) { if (!ipv6def && (ipdef->nranges || ipdef->nhosts)) ipv6def = ipdef; @@ -1545,14 +1545,14 @@ networkRadvdConfContents(virNetworkObjPtr network, char **configstr) virBuffer configbuf = VIR_BUFFER_INITIALIZER; int ret = -1; size_t i; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; bool v6present = false, dhcp6 = false; *configstr = NULL; /* Check if DHCPv6 is needed */ for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET6, i)); i++) { v6present = true; if (ipdef->nranges || ipdef->nhosts) { @@ -1582,12 +1582,12 @@ networkRadvdConfContents(virNetworkObjPtr network, char **configstr) /* add a section for each IPv6 address in the config */ for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET6, i)); i++) { int prefix; char *netaddr; - prefix = virNetworkIpDefPrefix(ipdef); + prefix = virNetworkIPDefPrefix(ipdef); if (prefix < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("bridge '%s' has an invalid prefix"), @@ -1677,7 +1677,7 @@ networkStartRadvd(virNetworkDriverStatePtr driver, goto cleanup; } - if (!virNetworkDefGetIpByIndex(network->def, AF_INET6, 0)) { + if (!virNetworkDefGetIPByIndex(network->def, AF_INET6, 0)) { /* no IPv6 addresses, so we don't need to run radvd */ ret = 0; goto cleanup; @@ -1775,7 +1775,7 @@ networkRefreshRadvd(virNetworkDriverStatePtr driver, if (network->radvdPid <= 0 || (kill(network->radvdPid, 0) < 0)) return networkStartRadvd(driver, network); - if (!virNetworkDefGetIpByIndex(network->def, AF_INET6, 0)) { + if (!virNetworkDefGetIPByIndex(network->def, AF_INET6, 0)) { /* no IPv6 addresses, so we don't need to run radvd */ return 0; } @@ -1882,7 +1882,7 @@ networkReloadFirewallRules(virNetworkDriverStatePtr driver) /* Enable IP Forwarding. Return 0 for success, -1 for failure. */ static int -networkEnableIpForwarding(bool enableIPv4, bool enableIPv6) +networkEnableIPForwarding(bool enableIPv4, bool enableIPv6) { int ret = 0; #ifdef HAVE_SYSCTLBYNAME @@ -1909,7 +1909,7 @@ networkSetIPv6Sysctls(virNetworkObjPtr network) { char *field = NULL; int ret = -1; - bool enableIPv6 = !!virNetworkDefGetIpByIndex(network->def, AF_INET6, 0); + bool enableIPv6 = !!virNetworkDefGetIPByIndex(network->def, AF_INET6, 0); /* set disable_ipv6 if there are no ipv6 addresses defined for the * network. But also unset it if there *are* ipv6 addresses, as we @@ -1975,9 +1975,9 @@ networkSetIPv6Sysctls(virNetworkObjPtr network) /* add an IP address to a bridge */ static int networkAddAddrToBridge(virNetworkObjPtr network, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { - int prefix = virNetworkIpDefPrefix(ipdef); + int prefix = virNetworkIPDefPrefix(ipdef); if (prefix < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -2044,14 +2044,14 @@ networkAddRouteToBridge(virNetworkObjPtr network, static int networkWaitDadFinish(virNetworkObjPtr network) { - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virSocketAddrPtr *addrs = NULL, addr = NULL; size_t naddrs = 0; int ret = -1; VIR_DEBUG("Begin waiting for IPv6 DAD on network %s", network->def->name); - while ((ipdef = virNetworkDefGetIpByIndex(network->def, + while ((ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET6, naddrs))) { addr = &ipdef->address; if (VIR_APPEND_ELEMENT_COPY(addrs, naddrs, addr) < 0) @@ -2074,7 +2074,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, size_t i; bool v4present = false, v6present = false; virErrorPtr save_err = NULL; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virNetworkRouteDefPtr routedef; char *macTapIfName = NULL; int tapfd = -1; @@ -2147,7 +2147,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, goto err1; for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_UNSPEC, i)); i++) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) v4present = true; @@ -2185,7 +2185,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, /* If forward.type != NONE, turn on global IP forwarding */ if (network->def->forward.type != VIR_NETWORK_FORWARD_NONE && - networkEnableIpForwarding(v4present, v6present) < 0) { + networkEnableIPForwarding(v4present, v6present) < 0) { virReportSystemError(errno, "%s", _("failed to enable IP forwarding")); goto err3; @@ -2917,7 +2917,7 @@ networkValidate(virNetworkDriverStatePtr driver, size_t i, j; bool vlanUsed, vlanAllowed, badVlanUse = false; virPortGroupDefPtr defaultPortGroup = NULL; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; bool ipv4def = false, ipv6def = false; bool bandwidthAllowed = true; bool usesInterface = false, usesAddress = false; @@ -2949,7 +2949,7 @@ networkValidate(virNetworkDriverStatePtr driver, virNetworkForwardTypeToString(def->forward.type)); return -1; } - if (virNetworkDefGetIpByIndex(def, AF_UNSPEC, 0)) { + if (virNetworkDefGetIPByIndex(def, AF_UNSPEC, 0)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported <ip> element in network %s " "with forward mode='%s'"), @@ -3022,7 +3022,7 @@ networkValidate(virNetworkDriverStatePtr driver, * on one IPv6 address per defined network */ for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i)); i++) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) { if (ipdef->nranges || ipdef->nhosts) { @@ -3313,7 +3313,7 @@ networkUpdate(virNetworkPtr net, virNetworkObjPtr network = NULL; int isActive, ret = -1; size_t i; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; bool oldDhcpActive = false; bool needFirewallRefresh = false; @@ -3330,7 +3330,7 @@ networkUpdate(virNetworkPtr net, /* see if we are listening for dhcp pre-modification */ for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET, i)); i++) { if (ipdef->nranges || ipdef->nhosts) { oldDhcpActive = true; @@ -3425,7 +3425,7 @@ networkUpdate(virNetworkPtr net, bool newDhcpActive = false; for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET, i)); + (ipdef = virNetworkDefGetIPByIndex(network->def, AF_INET, i)); i++) { if (ipdef->nranges || ipdef->nhosts) { newDhcpActive = true; @@ -3694,7 +3694,7 @@ networkGetDHCPLeases(virNetworkPtr network, const char *mac_tmp = NULL; virJSONValuePtr lease_tmp = NULL; virJSONValuePtr leases_array = NULL; - virNetworkIpDefPtr ipdef_tmp = NULL; + virNetworkIPDefPtr ipdef_tmp = NULL; virNetworkDHCPLeasePtr lease = NULL; virNetworkDHCPLeasePtr *leases_ret = NULL; virNetworkObjPtr obj; @@ -3801,7 +3801,7 @@ networkGetDHCPLeases(virNetworkPtr network, } if (!ipv6 && VIR_SOCKET_ADDR_IS_FAMILY(&ipdef_tmp->address, AF_INET)) { - lease->prefix = virSocketAddrGetIpPrefix(&ipdef_tmp->address, + lease->prefix = virSocketAddrGetIPPrefix(&ipdef_tmp->address, &ipdef_tmp->netmask, ipdef_tmp->prefix); break; @@ -4717,7 +4717,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr) int ret = -1; virNetworkObjPtr network; virNetworkDefPtr netdef; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virSocketAddr addr; virSocketAddrPtr addrptr = NULL; char *dev_name = NULL; @@ -4736,7 +4736,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr) case VIR_NETWORK_FORWARD_NONE: case VIR_NETWORK_FORWARD_NAT: case VIR_NETWORK_FORWARD_ROUTE: - ipdef = virNetworkDefGetIpByIndex(netdef, AF_UNSPEC, 0); + ipdef = virNetworkDefGetIPByIndex(netdef, AF_UNSPEC, 0); if (!ipdef) { virReportError(VIR_ERR_INTERNAL_ERROR, _("network '%s' doesn't have an IP address"), diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c index bd7508c..b41a1ba 100644 --- a/src/network/bridge_driver_linux.c +++ b/src/network/bridge_driver_linux.c @@ -68,7 +68,7 @@ int networkCheckRouteCollision(virNetworkDefPtr def) while (cur) { char iface[17], dest[128], mask[128]; unsigned int addr_val, mask_val; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virNetworkRouteDefPtr routedef; int num; size_t i; @@ -100,13 +100,13 @@ int networkCheckRouteCollision(virNetworkDefPtr def) addr_val &= mask_val; for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_INET, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_INET, i)); i++) { unsigned int net_dest; virSocketAddr netmask; - if (virNetworkIpDefNetmask(ipdef, &netmask) < 0) { + if (virNetworkIPDefNetmask(ipdef, &netmask) < 0) { VIR_WARN("Failed to get netmask of '%s'", def->bridge); continue; @@ -165,9 +165,9 @@ static const char networkLocalBroadcast[] = "255.255.255.255/32"; static int networkAddMasqueradingFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { - int prefix = virNetworkIpDefPrefix(ipdef); + int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); if (prefix < 0) { @@ -279,9 +279,9 @@ networkAddMasqueradingFirewallRules(virFirewallPtr fw, static int networkRemoveMasqueradingFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { - int prefix = virNetworkIpDefPrefix(ipdef); + int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); if (prefix < 0) @@ -349,9 +349,9 @@ networkRemoveMasqueradingFirewallRules(virFirewallPtr fw, static int networkAddRoutingFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { - int prefix = virNetworkIpDefPrefix(ipdef); + int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); if (prefix < 0) { @@ -384,9 +384,9 @@ networkAddRoutingFirewallRules(virFirewallPtr fw, static int networkRemoveRoutingFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { - int prefix = virNetworkIpDefPrefix(ipdef); + int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); if (prefix < 0) @@ -415,12 +415,12 @@ networkAddGeneralIPv4FirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipv4def; + virNetworkIPDefPtr ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ for (i = 0; - (ipv4def = virNetworkDefGetIpByIndex(def, AF_INET, i)); + (ipv4def = virNetworkDefGetIPByIndex(def, AF_INET, i)); i++) { if (ipv4def->nranges || ipv4def->nhosts || ipv4def->tftproot) break; @@ -452,10 +452,10 @@ networkRemoveGeneralIPv4FirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipv4def; + virNetworkIPDefPtr ipv4def; for (i = 0; - (ipv4def = virNetworkDefGetIpByIndex(def, AF_INET, i)); + (ipv4def = virNetworkDefGetIPByIndex(def, AF_INET, i)); i++) { if (ipv4def->nranges || ipv4def->nhosts || ipv4def->tftproot) break; @@ -487,7 +487,7 @@ networkAddGeneralIPv6FirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { - if (!virNetworkDefGetIpByIndex(def, AF_INET6, 0) && + if (!virNetworkDefGetIPByIndex(def, AF_INET6, 0) && !def->ipv6nogw) { return; } @@ -499,7 +499,7 @@ networkAddGeneralIPv6FirewallRules(virFirewallPtr fw, /* Allow traffic between guests on the same bridge */ iptablesAddForwardAllowCross(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge); - if (virNetworkDefGetIpByIndex(def, AF_INET6, 0)) { + if (virNetworkDefGetIPByIndex(def, AF_INET6, 0)) { /* allow DNS over IPv6 */ iptablesAddTcpInput(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge, 53); iptablesAddUdpInput(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge, 53); @@ -511,12 +511,12 @@ static void networkRemoveGeneralIPv6FirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { - if (!virNetworkDefGetIpByIndex(def, AF_INET6, 0) && + if (!virNetworkDefGetIPByIndex(def, AF_INET6, 0) && !def->ipv6nogw) { return; } - if (virNetworkDefGetIpByIndex(def, AF_INET6, 0)) { + if (virNetworkDefGetIPByIndex(def, AF_INET6, 0)) { iptablesRemoveUdpInput(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge, 547); iptablesRemoveUdpInput(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge, 53); iptablesRemoveTcpInput(fw, VIR_FIREWALL_LAYER_IPV6, def->bridge, 53); @@ -553,12 +553,12 @@ networkAddChecksumFirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipv4def; + virNetworkIPDefPtr ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ for (i = 0; - (ipv4def = virNetworkDefGetIpByIndex(def, AF_INET, i)); + (ipv4def = virNetworkDefGetIPByIndex(def, AF_INET, i)); i++) { if (ipv4def->nranges || ipv4def->nhosts) break; @@ -579,12 +579,12 @@ networkRemoveChecksumFirewallRules(virFirewallPtr fw, virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipv4def; + virNetworkIPDefPtr ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ for (i = 0; - (ipv4def = virNetworkDefGetIpByIndex(def, AF_INET, i)); + (ipv4def = virNetworkDefGetIPByIndex(def, AF_INET, i)); i++) { if (ipv4def->nranges || ipv4def->nhosts) break; @@ -596,9 +596,9 @@ networkRemoveChecksumFirewallRules(virFirewallPtr fw, static int -networkAddIpSpecificFirewallRules(virFirewallPtr fw, +networkAddIPSpecificFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { /* NB: in the case of IPv6, routing rules are added when the * forward mode is NAT. This is because IPv6 has no NAT. @@ -617,9 +617,9 @@ networkAddIpSpecificFirewallRules(virFirewallPtr fw, static int -networkRemoveIpSpecificFirewallRules(virFirewallPtr fw, +networkRemoveIPSpecificFirewallRules(virFirewallPtr fw, virNetworkDefPtr def, - virNetworkIpDefPtr ipdef) + virNetworkIPDefPtr ipdef) { if (def->forward.type == VIR_NETWORK_FORWARD_NAT) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) @@ -637,7 +637,7 @@ networkRemoveIpSpecificFirewallRules(virFirewallPtr fw, int networkAddFirewallRules(virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virFirewallPtr fw = NULL; int ret = -1; @@ -648,18 +648,18 @@ int networkAddFirewallRules(virNetworkDefPtr def) networkAddGeneralFirewallRules(fw, def); for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i)); i++) { - if (networkAddIpSpecificFirewallRules(fw, def, ipdef) < 0) + if (networkAddIPSpecificFirewallRules(fw, def, ipdef) < 0) goto cleanup; } virFirewallStartRollback(fw, 0); for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i)); i++) { - if (networkRemoveIpSpecificFirewallRules(fw, def, ipdef) < 0) + if (networkRemoveIPSpecificFirewallRules(fw, def, ipdef) < 0) goto cleanup; } networkRemoveGeneralFirewallRules(fw, def); @@ -680,7 +680,7 @@ int networkAddFirewallRules(virNetworkDefPtr def) void networkRemoveFirewallRules(virNetworkDefPtr def) { size_t i; - virNetworkIpDefPtr ipdef; + virNetworkIPDefPtr ipdef; virFirewallPtr fw = NULL; fw = virFirewallNew(); @@ -691,9 +691,9 @@ void networkRemoveFirewallRules(virNetworkDefPtr def) virFirewallStartTransaction(fw, VIR_FIREWALL_TRANSACTION_IGNORE_ERRORS); for (i = 0; - (ipdef = virNetworkDefGetIpByIndex(def, AF_UNSPEC, i)); + (ipdef = virNetworkDefGetIPByIndex(def, AF_UNSPEC, i)); i++) { - if (networkRemoveIpSpecificFirewallRules(fw, def, ipdef) < 0) + if (networkRemoveIPSpecificFirewallRules(fw, def, ipdef) < 0) goto cleanup; } networkRemoveGeneralFirewallRules(fw, def); diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index b7be291..0ab7c08 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -820,7 +820,7 @@ iptablesHandleSrcMacAddr(virFirewallPtr fw, static int -iptablesHandleIpHdr(virFirewallPtr fw, +iptablesHandleIPHdr(virFirewallPtr fw, virFirewallRulePtr fwrule, virNWFilterVarCombIterPtr vars, ipHdrDataDefPtr ipHdr, @@ -972,7 +972,7 @@ iptablesHandleIpHdr(virFirewallPtr fw, static int -iptablesHandleIpHdrAfterStateMatch(virFirewallPtr fw, +iptablesHandleIPHdrAfterStateMatch(virFirewallPtr fw, virFirewallRulePtr fwrule, virNWFilterVarCombIterPtr vars, ipHdrDataDefPtr ipHdr, @@ -1200,7 +1200,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.tcpHdrFilter.ipHdr, directionIn, @@ -1259,7 +1259,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.udpHdrFilter.ipHdr, directionIn, @@ -1289,7 +1289,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.udpliteHdrFilter.ipHdr, directionIn, @@ -1314,7 +1314,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.espHdrFilter.ipHdr, directionIn, @@ -1339,7 +1339,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.ahHdrFilter.ipHdr, directionIn, @@ -1364,7 +1364,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.sctpHdrFilter.ipHdr, directionIn, @@ -1400,7 +1400,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.icmpHdrFilter.ipHdr, directionIn, @@ -1461,7 +1461,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.igmpHdrFilter.ipHdr, directionIn, @@ -1486,7 +1486,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, &srcMacSkipped) < 0) goto cleanup; - if (iptablesHandleIpHdr(fw, fwrule, + if (iptablesHandleIPHdr(fw, fwrule, vars, &rule->p.allHdrFilter.ipHdr, directionIn, @@ -1534,7 +1534,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, directionIn, rule); - if (iptablesHandleIpHdrAfterStateMatch(fw, fwrule, + if (iptablesHandleIPHdrAfterStateMatch(fw, fwrule, vars, &rule->p.allHdrFilter.ipHdr, directionIn) < 0) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 820dc22..8c77eff 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -220,7 +220,7 @@ openvzReadNetworkConf(virDomainDefPtr def, goto error; net->type = VIR_DOMAIN_NET_TYPE_ETHERNET; - if (virDomainNetAppendIpAddress(net, token, AF_UNSPEC, 0) < 0) + if (virDomainNetAppendIPAddress(net, token, AF_UNSPEC, 0) < 0) goto error; if (VIR_APPEND_ELEMENT_COPY(def->nets, def->nnets, net) < 0) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fa05046..294a1b0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7048,7 +7048,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, char *script = net->script; char *brname = net->data.bridge.brname; size_t nips = net->nips; - virDomainNetIpDefPtr *ips = net->ips; + virDomainNetIPDefPtr *ips = net->ips; memset(net, 0, sizeof(*net)); diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 98cb4ca..12fe96a 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -1011,7 +1011,7 @@ virSocketAddrPrefixToNetmask(unsigned int prefix, } /** - * virSocketAddrGetIpPrefix: + * virSocketAddrGetIPPrefix: * @address: network address * @netmask: netmask for this network * @prefix: prefix if specified instead of netmask @@ -1020,7 +1020,7 @@ virSocketAddrPrefixToNetmask(unsigned int prefix, */ int -virSocketAddrGetIpPrefix(const virSocketAddr *address, +virSocketAddrGetIPPrefix(const virSocketAddr *address, const virSocketAddr *netmask, int prefix) { diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index c7aaa61..990e31c 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -125,7 +125,7 @@ int virSocketAddrGetNumNetmaskBits(const virSocketAddr *netmask); int virSocketAddrPrefixToNetmask(unsigned int prefix, virSocketAddrPtr netmask, int family); -int virSocketAddrGetIpPrefix(const virSocketAddr *address, +int virSocketAddrGetIPPrefix(const virSocketAddr *address, const virSocketAddr *netmask, int prefix); bool virSocketAddrEqual(const virSocketAddr *s1, diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c index 4cfc365..0b944b6 100644 --- a/src/vbox/vbox_network.c +++ b/src/vbox/vbox_network.c @@ -376,7 +376,7 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start) char *networkNameUtf8 = NULL; IHostNetworkInterface *networkInterface = NULL; virNetworkDefPtr def = virNetworkDefParseString(xml); - virNetworkIpDefPtr ipdef = NULL; + virNetworkIPDefPtr ipdef = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; vboxIIDUnion vboxnetiid; virSocketAddr netmask; @@ -402,11 +402,11 @@ vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start) * If there weren't any IPv4 addresses, ignore the network (since it's * required below to have an IPv4 address) */ - ipdef = virNetworkDefGetIpByIndex(def, AF_INET, 0); + ipdef = virNetworkDefGetIPByIndex(def, AF_INET, 0); if (!ipdef) goto cleanup; - if (virNetworkIpDefNetmask(ipdef, &netmask) < 0) + if (virNetworkIPDefNetmask(ipdef, &netmask) < 0) goto cleanup; /* the current limitation of hostonly network is that you can't @@ -762,7 +762,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags) { vboxGlobalData *data = network->conn->privateData; virNetworkDefPtr def = NULL; - virNetworkIpDefPtr ipdef = NULL; + virNetworkIPDefPtr ipdef = NULL; char *networkNameUtf8 = NULL; PRUnichar *networkInterfaceNameUtf16 = NULL; IHostNetworkInterface *networkInterface = NULL; diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index 98a22b8..2fe29fd 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -935,7 +935,7 @@ xenParseVif(virConfPtr conf, virDomainDefPtr def, const char *vif_typename) if (bridge[0] && VIR_STRDUP(net->data.bridge.brname, bridge) < 0) goto cleanup; } - if (ip[0] && virDomainNetAppendIpAddress(net, ip, AF_INET, 0) < 0) + if (ip[0] && virDomainNetAppendIPAddress(net, ip, AF_INET, 0) < 0) goto cleanup; if (script && script[0] && diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c index 653b7b3..21de1a2 100644 --- a/src/xenconfig/xen_sxpr.c +++ b/src/xenconfig/xen_sxpr.c @@ -619,14 +619,14 @@ xenParseSxprNets(virDomainDefPtr def, VIR_STRDUP(net->script, tmp2) < 0) goto cleanup; tmp = sexpr_node(node, "device/vif/ip"); - if (tmp && virDomainNetAppendIpAddress(net, tmp, AF_UNSPEC, 0) < 0) + if (tmp && virDomainNetAppendIPAddress(net, tmp, AF_UNSPEC, 0) < 0) goto cleanup; } else { net->type = VIR_DOMAIN_NET_TYPE_ETHERNET; if (VIR_STRDUP(net->script, tmp2) < 0) goto cleanup; tmp = sexpr_node(node, "device/vif/ip"); - if (tmp && virDomainNetAppendIpAddress(net, tmp, AF_UNSPEC, 0) < 0) + if (tmp && virDomainNetAppendIPAddress(net, tmp, AF_UNSPEC, 0) < 0) goto cleanup; } -- 2.5.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list