提交 19f128ee 编写于 作者: D Daniel P. Berrange

Replace use of networkReportError with virReportError

Update the linux bridge driver to use virReportError instead
of the networkReportError custom macro
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 5b924be9
......@@ -515,7 +515,6 @@ msg_gen_function += VMX_ERROR
msg_gen_function += XENXS_ERROR
msg_gen_function += lxcError
msg_gen_function += libxlError
msg_gen_function += networkReportError
msg_gen_function += nodeReportError
msg_gen_function += openvzError
msg_gen_function += qemuReportError
......
......@@ -70,10 +70,6 @@
#define VIR_FROM_THIS VIR_FROM_NETWORK
#define networkReportError(code, ...) \
virReportErrorHelper(VIR_FROM_NETWORK, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
/* Main driver state */
struct network_driver {
virMutex lock;
......@@ -849,7 +845,7 @@ networkStartRadvd(virNetworkObjPtr network)
prefix = virNetworkIpDefPrefix(ipdef);
if (prefix < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("bridge '%s' has an invalid prefix"),
network->def->bridge);
goto cleanup;
......@@ -935,7 +931,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
const char *forwardIf = virNetworkDefForwardIf(network->def, 0);
if (prefix < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid prefix or netmask for '%s'"),
network->def->bridge);
goto masqerr1;
......@@ -947,7 +943,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
prefix,
network->def->bridge,
forwardIf) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow forwarding from '%s'"),
network->def->bridge);
goto masqerr1;
......@@ -961,7 +957,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
prefix,
network->def->bridge,
forwardIf) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow forwarding to '%s'"),
network->def->bridge);
goto masqerr2;
......@@ -996,7 +992,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
prefix,
forwardIf,
NULL) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
forwardIf ?
_("failed to add iptables rule to enable masquerading to %s") :
_("failed to add iptables rule to enable masquerading"),
......@@ -1010,7 +1006,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
prefix,
forwardIf,
"udp") < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
forwardIf ?
_("failed to add iptables rule to enable UDP masquerading to %s") :
_("failed to add iptables rule to enable UDP masquerading"),
......@@ -1024,7 +1020,7 @@ networkAddMasqueradingIptablesRules(struct network_driver *driver,
prefix,
forwardIf,
"tcp") < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
forwardIf ?
_("failed to add iptables rule to enable TCP masquerading to %s") :
_("failed to add iptables rule to enable TCP masquerading"),
......@@ -1109,7 +1105,7 @@ networkAddRoutingIptablesRules(struct network_driver *driver,
const char *forwardIf = virNetworkDefForwardIf(network->def, 0);
if (prefix < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid prefix or netmask for '%s'"),
network->def->bridge);
goto routeerr1;
......@@ -1121,7 +1117,7 @@ networkAddRoutingIptablesRules(struct network_driver *driver,
prefix,
network->def->bridge,
forwardIf) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow routing from '%s'"),
network->def->bridge);
goto routeerr1;
......@@ -1133,7 +1129,7 @@ networkAddRoutingIptablesRules(struct network_driver *driver,
prefix,
network->def->bridge,
forwardIf) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow routing to '%s'"),
network->def->bridge);
goto routeerr2;
......@@ -1187,7 +1183,7 @@ networkAddGeneralIp6tablesRules(struct network_driver *driver,
if (iptablesAddForwardRejectOut(driver->iptables, AF_INET6,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add ip6tables rule to block outbound traffic from '%s'"),
network->def->bridge);
goto err1;
......@@ -1195,7 +1191,7 @@ networkAddGeneralIp6tablesRules(struct network_driver *driver,
if (iptablesAddForwardRejectIn(driver->iptables, AF_INET6,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add ip6tables rule to block inbound traffic to '%s'"),
network->def->bridge);
goto err2;
......@@ -1204,7 +1200,7 @@ networkAddGeneralIp6tablesRules(struct network_driver *driver,
/* Allow traffic between guests on the same bridge */
if (iptablesAddForwardAllowCross(driver->iptables, AF_INET6,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add ip6tables rule to allow cross bridge traffic on '%s'"),
network->def->bridge);
goto err3;
......@@ -1213,7 +1209,7 @@ networkAddGeneralIp6tablesRules(struct network_driver *driver,
/* allow DNS over IPv6 */
if (iptablesAddTcpInput(driver->iptables, AF_INET6,
network->def->bridge, 53) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add ip6tables rule to allow DNS requests from '%s'"),
network->def->bridge);
goto err4;
......@@ -1221,7 +1217,7 @@ networkAddGeneralIp6tablesRules(struct network_driver *driver,
if (iptablesAddUdpInput(driver->iptables, AF_INET6,
network->def->bridge, 53) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add ip6tables rule to allow DNS requests from '%s'"),
network->def->bridge);
goto err5;
......@@ -1274,7 +1270,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (iptablesAddTcpInput(driver->iptables, AF_INET,
network->def->bridge, 67) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow DHCP requests from '%s'"),
network->def->bridge);
goto err1;
......@@ -1282,7 +1278,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (iptablesAddUdpInput(driver->iptables, AF_INET,
network->def->bridge, 67) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow DHCP requests from '%s'"),
network->def->bridge);
goto err2;
......@@ -1305,7 +1301,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
/* allow DNS requests through to dnsmasq */
if (iptablesAddTcpInput(driver->iptables, AF_INET,
network->def->bridge, 53) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow DNS requests from '%s'"),
network->def->bridge);
goto err3;
......@@ -1313,7 +1309,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (iptablesAddUdpInput(driver->iptables, AF_INET,
network->def->bridge, 53) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow DNS requests from '%s'"),
network->def->bridge);
goto err4;
......@@ -1323,7 +1319,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (ipv4def && ipv4def->tftproot &&
iptablesAddUdpInput(driver->iptables, AF_INET,
network->def->bridge, 69) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow TFTP requests from '%s'"),
network->def->bridge);
goto err5;
......@@ -1333,7 +1329,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (iptablesAddForwardRejectOut(driver->iptables, AF_INET,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to block outbound traffic from '%s'"),
network->def->bridge);
goto err6;
......@@ -1341,7 +1337,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
if (iptablesAddForwardRejectIn(driver->iptables, AF_INET,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to block inbound traffic to '%s'"),
network->def->bridge);
goto err7;
......@@ -1350,7 +1346,7 @@ networkAddGeneralIptablesRules(struct network_driver *driver,
/* Allow traffic between guests on the same bridge */
if (iptablesAddForwardAllowCross(driver->iptables, AF_INET,
network->def->bridge) < 0) {
networkReportError(VIR_ERR_SYSTEM_ERROR,
virReportError(VIR_ERR_SYSTEM_ERROR,
_("failed to add iptables rule to allow cross bridge traffic on '%s'"),
network->def->bridge);
goto err8;
......@@ -1700,7 +1696,7 @@ networkCheckRouteCollision(virNetworkObjPtr network)
if ((net_dest == addr_val) &&
(netmask.data.inet4.sin_addr.s_addr == mask_val)) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Network is already in use by interface %s"),
iface);
ret = -1;
......@@ -1721,7 +1717,7 @@ networkAddAddrToBridge(virNetworkObjPtr network,
int prefix = virNetworkIpDefPrefix(ipdef);
if (prefix < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("bridge '%s' has an invalid netmask or IP address"),
network->def->bridge);
return -1;
......@@ -1828,7 +1824,7 @@ networkStartNetworkVirtual(struct network_driver *driver,
goto err4;
if (virNetDevBandwidthSet(network->def->bridge, network->def->bandwidth) < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot set bandwidth limits on %s"),
network->def->bridge);
goto err5;
......@@ -1962,7 +1958,7 @@ networkStartNetwork(struct network_driver *driver,
int ret = 0;
if (virNetworkObjIsActive(network)) {
networkReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("network is already active"));
return -1;
}
......@@ -2064,7 +2060,7 @@ static virNetworkPtr networkLookupByUUID(virConnectPtr conn,
network = virNetworkFindByUUID(&driver->networks, uuid);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
......@@ -2087,7 +2083,7 @@ static virNetworkPtr networkLookupByName(virConnectPtr conn,
network = virNetworkFindByName(&driver->networks, name);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
_("no network with matching name '%s'"), name);
goto cleanup;
}
......@@ -2216,7 +2212,7 @@ static int networkIsActive(virNetworkPtr net)
obj = virNetworkFindByUUID(&driver->networks, net->uuid);
networkDriverUnlock(driver);
if (!obj) {
networkReportError(VIR_ERR_NO_NETWORK, NULL);
virReportError(VIR_ERR_NO_NETWORK, NULL);
goto cleanup;
}
ret = virNetworkObjIsActive(obj);
......@@ -2237,7 +2233,7 @@ static int networkIsPersistent(virNetworkPtr net)
obj = virNetworkFindByUUID(&driver->networks, net->uuid);
networkDriverUnlock(driver);
if (!obj) {
networkReportError(VIR_ERR_NO_NETWORK, NULL);
virReportError(VIR_ERR_NO_NETWORK, NULL);
goto cleanup;
}
ret = obj->persistent;
......@@ -2337,8 +2333,10 @@ static virNetworkPtr networkDefine(virConnectPtr conn, const char *xml) {
if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) {
if (ipdef->nranges || ipdef->nhosts) {
if (ipv4def) {
networkReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("Multiple dhcp sections found. dhcp is supported only for a single IPv4 address on each network"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Multiple dhcp sections found. "
"dhcp is supported only for a "
"single IPv4 address on each network"));
goto cleanup;
} else {
ipv4def = ipdef;
......@@ -2392,13 +2390,13 @@ static int networkUndefine(virNetworkPtr net) {
network = virNetworkFindByUUID(&driver->networks, net->uuid);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
if (virNetworkObjIsActive(network)) {
networkReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("network is still active"));
goto cleanup;
}
......@@ -2479,7 +2477,7 @@ static int networkStart(virNetworkPtr net) {
network = virNetworkFindByUUID(&driver->networks, net->uuid);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
......@@ -2502,13 +2500,13 @@ static int networkDestroy(virNetworkPtr net) {
network = virNetworkFindByUUID(&driver->networks, net->uuid);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
if (!virNetworkObjIsActive(network)) {
networkReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("network is not active"));
goto cleanup;
}
......@@ -2542,7 +2540,7 @@ static char *networkGetXMLDesc(virNetworkPtr net,
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
......@@ -2570,13 +2568,13 @@ static char *networkGetBridgeName(virNetworkPtr net) {
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching id"));
goto cleanup;
}
if (!(network->def->bridge)) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' does not have a bridge name."),
network->def->name);
goto cleanup;
......@@ -2602,7 +2600,7 @@ static int networkGetAutostart(virNetworkPtr net,
network = virNetworkFindByUUID(&driver->networks, net->uuid);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
......@@ -2627,13 +2625,13 @@ static int networkSetAutostart(virNetworkPtr net,
network = virNetworkFindByUUID(&driver->networks, net->uuid);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
goto cleanup;
}
if (!network->persistent) {
networkReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot set autostart for transient network"));
goto cleanup;
}
......@@ -2763,7 +2761,7 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
network = virNetworkFindByName(&driver->networks, iface->data.network.name);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
_("no network with matching name '%s'"),
iface->data.network.name);
goto cleanup;
......@@ -2879,8 +2877,9 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
* any error if exclusive use is required but could not be acquired).
*/
if ((netdef->nForwardIfs <= 0) && (netdef->nForwardPfs <= 0)) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but has no forward dev and no interface pool"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but "
"has no forward dev and no interface pool"),
netdef->name);
goto cleanup;
} else {
......@@ -2897,14 +2896,14 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
if ((netdef->nForwardPfs > 0) && (netdef->nForwardIfs <= 0)) {
if ((virNetDevGetVirtualFunctions(netdef->forwardPfs->dev,
&vfname, &num_virt_fns)) < 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not get Virtual functions on %s"),
netdef->forwardPfs->dev);
goto cleanup;
}
if (num_virt_fns == 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No Vf's present on SRIOV PF %s"),
netdef->forwardPfs->dev);
goto cleanup;
......@@ -2957,8 +2956,9 @@ networkAllocateActualDevice(virDomainNetDefPtr iface)
}
/* dev points at the physical device we want to use */
if (!dev) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' requires exclusive access to interfaces, but none are available"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' requires exclusive access "
"to interfaces, but none are available"),
netdef->name);
goto cleanup;
}
......@@ -3020,7 +3020,7 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
network = virNetworkFindByName(&driver->networks, iface->data.network.name);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
_("no network with matching name '%s'"),
iface->data.network.name);
goto cleanup;
......@@ -3028,15 +3028,17 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
actualDev = virDomainNetGetActualDirectDev(iface);
if (!actualDev) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("the interface uses a direct mode, but has no source dev"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("the interface uses a direct "
"mode, but has no source dev"));
goto cleanup;
}
netdef = network->def;
if (netdef->nForwardIfs == 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but has no forward dev and no interface pool"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but "
"has no forward dev and no interface pool"),
netdef->name);
goto cleanup;
} else {
......@@ -3053,7 +3055,7 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
}
/* dev points at the physical device we want to use */
if (!dev) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' doesn't have dev='%s' in use by domain"),
netdef->name, actualDev);
goto cleanup;
......@@ -3069,7 +3071,7 @@ networkNotifyActualDevice(virDomainNetDefPtr iface)
iface->data.network.actual->data.direct.virtPortProfile &&
(iface->data.network.actual->data.direct.virtPortProfile->virtPortType
== VIR_NETDEV_VPORT_PROFILE_8021QBH)))) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' claims dev='%s' is already in use by a different domain"),
netdef->name, actualDev);
goto cleanup;
......@@ -3121,7 +3123,7 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
network = virNetworkFindByName(&driver->networks, iface->data.network.name);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
_("no network with matching name '%s'"),
iface->data.network.name);
goto cleanup;
......@@ -3129,15 +3131,17 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
actualDev = virDomainNetGetActualDirectDev(iface);
if (!actualDev) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("the interface uses a direct mode, but has no source dev"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("the interface uses a direct "
"mode, but has no source dev"));
goto cleanup;
}
netdef = network->def;
if (netdef->nForwardIfs == 0) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but has no forward dev and no interface pool"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' uses a direct mode, but "
"has no forward dev and no interface pool"),
netdef->name);
goto cleanup;
} else {
......@@ -3152,7 +3156,7 @@ networkReleaseActualDevice(virDomainNetDefPtr iface)
}
/* dev points at the physical device we've been using */
if (!dev) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' doesn't have dev='%s' in use by domain"),
netdef->name, actualDev);
goto cleanup;
......@@ -3208,7 +3212,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
network = virNetworkFindByName(&driver->networks, netname);
networkDriverUnlock(driver);
if (!network) {
networkReportError(VIR_ERR_NO_NETWORK,
virReportError(VIR_ERR_NO_NETWORK,
_("no network with matching name '%s'"),
netname);
goto cleanup;
......@@ -3222,7 +3226,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
/* if there's an ipv4def, get it's address */
ipdef = virNetworkDefGetIpByIndex(netdef, AF_INET, 0);
if (!ipdef) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' doesn't have an IPv4 address"),
netdef->name);
break;
......@@ -3244,7 +3248,7 @@ networkGetNetworkAddress(const char *netname, char **netaddr)
dev_name = netdef->forwardIfs[0].dev;
if (!dev_name) {
networkReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("network '%s' has no associated interface or bridge"),
netdef->name);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册