]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
networkDestroy: Report error if network is inactive
authorCole Robinson <crobinso@redhat.com>
Fri, 29 May 2009 14:14:32 +0000 (14:14 +0000)
committerCole Robinson <crobinso@redhat.com>
Fri, 29 May 2009 14:14:32 +0000 (14:14 +0000)
This follows the same convention as domain drivers.

ChangeLog
src/network_driver.c

index f7d24151a2ad429b2b11ee3aff85f27c97116c93..c66c8704e97c7f613d4d156978ca29b9725b76bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 29 10:13:55 EDT 2009 Cole Robinson <crobinso@redhat.com>
+
+       * src/network_driver.c: networkDestroy: Report error if network
+       is inactive
+
 Fri May 29 10:10:00 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/qemu_driver.c: qemu_driver: Fix another domain startup error
index 29652d16d2e96fe88bfc07626846240eb7ebfcb2..3518e01bf60d0f6dcbb7a2f0dc790cbb1745eaf3 100644 (file)
@@ -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,