network: ensure floor sum is reset to zero when starting networks

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>
This commit is contained in:
Daniel P. Berrangé 2019-04-16 17:36:57 +01:00
parent aa9d4d27c1
commit 557a96e0f4
1 changed files with 2 additions and 0 deletions

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