From 545c815c4c4271d0f16841b06f33de027781497c Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 29 May 2009 14:14:32 +0000 Subject: [PATCH] networkDestroy: Report error if network is inactive This follows the same convention as domain drivers. --- ChangeLog | 5 +++++ src/network_driver.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index f7d24151a2..c66c8704e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 29 10:13:55 EDT 2009 Cole Robinson + + * src/network_driver.c: networkDestroy: Report error if network + is inactive + Fri May 29 10:10:00 EDT 2009 Cole Robinson * src/qemu_driver.c: qemu_driver: Fix another domain startup error diff --git a/src/network_driver.c b/src/network_driver.c index 29652d16d2..3518e01bf6 100644 --- a/src/network_driver.c +++ b/src/network_driver.c @@ -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,