summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLaine Stump <laine@laine.org>2017-04-25 12:26:43 -0400
committerLaine Stump <laine@laine.org>2017-04-28 09:41:46 -0400
commit7949de960eaba07661c1e0ab6e4aa945db8c1b25 (patch)
tree2adf48924986d2120565c9b08fb5677b64ab391b /src/network
parentcb182eb11d3a99adb06e188989899dcd488c43fc (diff)
downloadlibvirt-7949de960eaba07661c1e0ab6e4aa945db8c1b25.tar.gz
network: better log message when network is inactive during reconnect
If the network isn't active during networkNotifyActualDevice(), we would log an error message stating that the bridge device didn't exist. This patch adds a check to see if the network is active, making the logs more useful in the case that it isn't. Partially resolves: https://bugzilla.redhat.com/1442700
Diffstat (limited to 'src/network')
-rw-r--r--src/network/bridge_driver.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index d18b15b71e..3ba70180b8 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -4675,6 +4675,13 @@ networkNotifyActualDevice(virDomainDefPtr dom,
}
netdef = network->def;
+ if (!virNetworkObjIsActive(network)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("network '%s' is not active"),
+ netdef->name);
+ goto error;
+ }
+
/* if we're restarting libvirtd after an upgrade from a version
* that didn't save bridge name in actualNetDef for
* actualType==network, we need to copy it in so that it will be