[libvirt] [PATCH v4 01/29] network: ensure floor sum is reset to zero when starting networks

Daniel P. Berrangé posted 29 patches 6 years, 9 months ago
There is a newer version of this series
[libvirt] [PATCH v4 01/29] network: ensure floor sum is reset to zero when starting networks
Posted by Daniel P. Berrangé 6 years, 9 months ago
In extreme cases libvirt can get mixed up about what VMs are running and
attached to a network leading to the cached floor sum value being
outdated. When this happens the only option is to destroy the network
and then restart libvirtd. If we set floor sum back to zero when
starting the network, we avoid the need for a libvirtd restart at least.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/network/bridge_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 6e15e43ca6..3008846074 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2826,6 +2826,8 @@ networkStartNetwork(virNetworkDriverStatePtr driver,
         goto cleanup;
     }
 
+    virNetworkObjSetFloorSum(obj, 0);
+
     /* finally we can call the 'started' hook script if any */
     if (networkRunHook(obj, NULL, NULL,
                        VIR_HOOK_NETWORK_OP_STARTED,
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 01/29] network: ensure floor sum is reset to zero when starting networks
Posted by Laine Stump 6 years, 9 months ago
On 4/17/19 1:19 PM, Daniel P. Berrangé wrote:
> In extreme cases libvirt can get mixed up about what VMs are running and
> attached to a network leading to the cached floor sum value being
> outdated. When this happens the only option is to destroy the network
> and then restart libvirtd. If we set floor sum back to zero when
> starting the network, we avoid the need for a libvirtd restart at least.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>


Reviewed-by: Laine Stump <laine@laine.org>


> ---
>   src/network/bridge_driver.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 6e15e43ca6..3008846074 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -2826,6 +2826,8 @@ networkStartNetwork(virNetworkDriverStatePtr driver,
>           goto cleanup;
>       }
>   
> +    virNetworkObjSetFloorSum(obj, 0);
> +
>       /* finally we can call the 'started' hook script if any */
>       if (networkRunHook(obj, NULL, NULL,
>                          VIR_HOOK_NETWORK_OP_STARTED,


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list