]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: ensure floor sum is reset to zero when starting networks
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 16 Apr 2019 16:36:57 +0000 (17:36 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 18 Apr 2019 10:18:31 +0000 (11:18 +0100)
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.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/network/bridge_driver.c

index 6e15e43ca6995ad4e2506b95f7cdd47a54a8dad9..3008846074f6ecfdbfd711d977fdbf139177b156 100644 (file)
@@ -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,