]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: improve the error when try to undefine transient network
authorShanzhi Yu <shyu@redhat.com>
Sun, 6 Mar 2016 10:54:21 +0000 (18:54 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 Mar 2016 09:15:53 +0000 (10:15 +0100)
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1315059

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
src/network/bridge_driver.c

index 7ab9e29dc7ae895213bf4836e32d64d9913b6f47..01c2ed6b1f19519c99c692775ede3b7bf8def9ae 100644 (file)
@@ -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,