Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
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