[PATCH 4/8] network: Don't check if network is active in networkShutdownNetwork

Martin Kletzander posted 8 patches 1 month, 1 week ago
[PATCH 4/8] network: Don't check if network is active in networkShutdownNetwork
Posted by Martin Kletzander 1 month, 1 week ago
It skips the cleanup from networkStartNetwork and the only other path
already checks if the network is active or not.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
 src/network/bridge_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index d27a7e9b88c4..e507dcd4c5c9 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2405,9 +2405,6 @@ networkShutdownNetwork(virNetworkDriverState *driver,
 
     VIR_INFO("Shutting down network '%s'", def->name);
 
-    if (!virNetworkObjIsActive(obj))
-        return 0;
-
     stateFile = virNetworkConfigFile(cfg->stateDir, def->name);
     if (!stateFile)
         return -1;
-- 
2.46.0
Re: [PATCH 4/8] network: Don't check if network is active in networkShutdownNetwork
Posted by Laine Stump 3 weeks, 4 days ago
On 9/3/24 10:36 AM, Martin Kletzander wrote:
> It skips the cleanup from networkStartNetwork and the only other path> already checks if the network is active or not.
> 
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>

Reviewed-by: Laine Stump <laine@redhat.com>

> ---
>   src/network/bridge_driver.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index d27a7e9b88c4..e507dcd4c5c9 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2405,9 +2405,6 @@ networkShutdownNetwork(virNetworkDriverState *driver,
>   
>       VIR_INFO("Shutting down network '%s'", def->name);
>   
> -    if (!virNetworkObjIsActive(obj))
> -        return 0;
> -
>       stateFile = virNetworkConfigFile(cfg->stateDir, def->name);
>       if (!stateFile)
>           return -1;