render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From c85276bfbfda6818ae1dddbe91d971cb26669044 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <c85276bfbfda6818ae1dddbe91d971cb26669044@dist-git>
3e5111
From: Laine Stump <laine@laine.org>
3e5111
Date: Tue, 2 May 2017 12:31:52 -0400
3e5111
Subject: [PATCH] network: better log message when network is inactive during
3e5111
 reconnect
3e5111
3e5111
If the network isn't active during networkNotifyActualDevice(), we
3e5111
would log an error message stating that the bridge device didn't
3e5111
exist. This patch adds a check to see if the network is active, making
3e5111
the logs more useful in the case that it isn't.
3e5111
3e5111
Partially resolves: https://bugzilla.redhat.com/1442700
3e5111
3e5111
(cherry picked from commit 7949de960eaba07661c1e0ab6e4aa945db8c1b25)
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/network/bridge_driver.c | 7 +++++++
3e5111
 1 file changed, 7 insertions(+)
3e5111
3e5111
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
3e5111
index cb91a2c90..41bce794a 100644
3e5111
--- a/src/network/bridge_driver.c
3e5111
+++ b/src/network/bridge_driver.c
3e5111
@@ -4682,6 +4682,13 @@ networkNotifyActualDevice(virDomainDefPtr dom,
3e5111
     }
3e5111
     netdef = network->def;
3e5111
 
3e5111
+    if (!virNetworkObjIsActive(network)) {
3e5111
+        virReportError(VIR_ERR_OPERATION_INVALID,
3e5111
+                       _("network '%s' is not active"),
3e5111
+                       netdef->name);
3e5111
+        goto error;
3e5111
+    }
3e5111
+
3e5111
     /* if we're restarting libvirtd after an upgrade from a version
3e5111
      * that didn't save bridge name in actualNetDef for
3e5111
      * actualType==network, we need to copy it in so that it will be
3e5111
-- 
3e5111
2.12.2
3e5111