qemu: improve the error when try to undefine transient network

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1315059

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
This commit is contained in:
Shanzhi Yu 2016-03-06 18:54:21 +08:00 committed by Peter Krempa
parent 47fdf9bc3a
commit 347035f959

View 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,