[libvirt] [PATCH] networkDestroy: Report error if network is inactive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This follows the same convention as domain drivers.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/network_driver.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/network_driver.c b/src/network_driver.c
index 29652d1..3518e01 100644
--- a/src/network_driver.c
+++ b/src/network_driver.c
@@ -1238,6 +1238,12 @@ static int networkDestroy(virNetworkPtr net) {
         goto cleanup;
     }
 
+    if (!virNetworkIsActive(network)) {
+        networkReportError(net->conn, NULL, net, VIR_ERR_INTERNAL_ERROR,
+                           "%s", _("network is not active"));
+        goto cleanup;
+    }
+
     ret = networkShutdownNetworkDaemon(net->conn, driver, network);
     if (!network->persistent) {
         virNetworkRemoveInactive(&driver->networks,
-- 
1.6.0.6

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]