[PATCH] qemu: improve the error when try to undefine transient network

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

 



Signed-off-by: Shanzhi Yu <shyu@xxxxxxxxxx>
---
 src/network/bridge_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 7ab9e29..b62fdff 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3222,6 +3222,12 @@ networkUndefine(virNetworkPtr net)
     if (virNetworkObjIsActive(network))
         active = true;
 
+    if (!network->persistent) {
+        virReportError(VIR_ERR_OPERATION_INVALID,
+                       "%s", _("can't undefine transient network"));
+        goto cleanup;
+    }
+
     /* remove autostart link */
     if (virNetworkDeleteConfig(driver->networkConfigDir,
                                driver->networkAutostartDir,
-- 
1.8.3.1

--
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]