]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nwfilter: Instantiate active filter bindings during driver init
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Mon, 15 Oct 2018 08:26:28 +0000 (11:26 +0300)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 5 Nov 2018 12:10:47 +0000 (07:10 -0500)
Commit 57f5621f modified nwfilterInstantiateFilter to detect when
a filter binding was already present before attempting to add the
new binding and instantiate it. Additionally, the change to
nwfilterStateInitialize to call virNWFilterBindingObjListLoadAllConfigs
(from commit c21679fa3f) to load active domain filter bindings, but
not instantiate them eventually leads to a problem for the QEMU
driver reconnection logic after a daemon restart where the filter
bindings would no longer be instantiated.

Subsequent commit f14c37ce4c replaced the nwfilterInstantiateFilter
with virDomainConfNWFilterInstantiate which uses @ignoreExists to
detect presence of the filter and still did not restore the filter
instantiation call when making the new nwfilter bindings logic active.

Thus in order to instantiate any active domain filter, we will call
virNWFilterBuildAll with 'false' to indicate the need to go through
all the active bindings calling virNWFilterInstantiateFilter to
instantiate the filter bindings.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/nwfilter/nwfilter_driver.c

index 1ee5162b9a3bddd3dd59552fa2e645c76880a3d5..1ab906fd5a16d1520070121881499a46b0cd9fd3 100644 (file)
@@ -264,6 +264,9 @@ nwfilterStateInitialize(bool privileged,
     if (virNWFilterBindingObjListLoadAllConfigs(driver->bindings, driver->bindingDir) < 0)
         goto error;
 
+    if (virNWFilterBuildAll(driver, false) < 0)
+        goto error;
+
     nwfilterDriverUnlock();
 
     return 0;