From: Daniel P. Berrange berra...@redhat.com
Update the linux bridge driver to use virReportError instead
of the networkReportError custom macro
Signed-off-by: Daniel P. Berrange berra...@redhat.com
---
cfg.mk |1 -
src/network/bridge_driver.c | 344 ++-
2 files changed, 174 insertions(+), 171 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index ed2838c..e83c8b0 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -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
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 9b1964b..2962580 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -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,9 +845,9 @@ networkStartRadvd(virNetworkObjPtr network)
prefix = virNetworkIpDefPrefix(ipdef);
if (prefix 0) {
-networkReportError(VIR_ERR_INTERNAL_ERROR,
- _(bridge '%s' has an invalid prefix),
- network-def-bridge);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+ _(bridge '%s' has an invalid prefix),
+ network-def-bridge);
goto cleanup;
}
if (!(netaddr = virSocketAddrFormat(ipdef-address)))
@@ -935,9 +931,9 @@ networkAddMasqueradingIptablesRules(struct network_driver
*driver,
const char *forwardIf = virNetworkDefForwardIf(network-def, 0);
if (prefix 0) {
-networkReportError(VIR_ERR_INTERNAL_ERROR,
- _(Invalid prefix or netmask for '%s'),
- network-def-bridge);
+virReportError(VIR_ERR_INTERNAL_ERROR,
+ _(Invalid prefix or netmask for '%s'),
+ network-def-bridge);
goto masqerr1;
}
@@ -947,9 +943,9 @@ networkAddMasqueradingIptablesRules(struct network_driver
*driver,
prefix,
network-def-bridge,
forwardIf) 0) {
-networkReportError(VIR_ERR_SYSTEM_ERROR,
- _(failed to add iptables rule to allow forwarding
from '%s'),
- network-def-bridge);
+virReportError(VIR_ERR_SYSTEM_ERROR,
+ _(failed to add iptables rule to allow forwarding from
'%s'),
+ network-def-bridge);
goto masqerr1;
}
@@ -961,9 +957,9 @@ networkAddMasqueradingIptablesRules(struct network_driver
*driver,
prefix,
network-def-bridge,
forwardIf) 0) {
-networkReportError(VIR_ERR_SYSTEM_ERROR,
- _(failed to add iptables rule to allow forwarding
to '%s'),
- network-def-bridge);
+virReportError(VIR_ERR_SYSTEM_ERROR,
+ _(failed to add iptables rule to allow forwarding to
'%s'),
+ network-def-bridge);
goto masqerr2;
}
@@ -996,11 +992,11 @@ networkAddMasqueradingIptablesRules(struct network_driver
*driver,
prefix,
forwardIf,
NULL) 0) {
-networkReportError(VIR_ERR_SYSTEM_ERROR,
- forwardIf ?
- _(failed to add iptables rule to enable
masquerading to %s) :
- _(failed to add iptables rule to enable
masquerading),
- forwardIf);
+virReportError(VIR_ERR_SYSTEM_ERROR,
+ forwardIf ?
+ _(failed to add iptables rule to enable masquerading
to %s) :
+ _(failed to add iptables rule to enable masquerading),
+ forwardIf);
goto masqerr3;
}
@@ -1010,11 +1006,11 @@ networkAddMasqueradingIptablesRules(struct
network_driver *driver,
prefix,
forwardIf,
udp) 0) {
-networkReportError(VIR_ERR_SYSTEM_ERROR,
- forwardIf ?
- _(failed to add iptables rule to enable UDP
masquerading to %s) :
-