libvirt/src/nwfilter
Daniel P. Berrangé 65dc79f50b nwfilter: hold filter update lock when creating/deleting bindings
The nwfilter update lock is historically acquired by the virt
drivers in order to achieve serialization between nwfilter
define/undefine, and instantiation/teardown of filters.

When running in the modular daemons, however, the mutex that
the virt drivers are locking is in a completely different
process from the mutex that the nwfilter driver is locking.

Serialization is lost and thus call from the virt driver to
virNWFilterBindingCreateXML can deadlock with a concurrent
call to the virNWFilterDefineXML method.

The solution is surprisingly easy, the update lock simply
needs acquiring in the virNWFilterBindingCreateXML method
and virNWFilterBindingUndefine method instead of in the
virt drivers.

The only semantic difference here is that when a virtual
machine has multiple NICs, the instantiation and teardown
of filters is no longer serialized for the whole VM, but
rather for each NIC. This should not be a problem since
the virt drivers already need to cope with tearing down
a partially created VM where only some of the NICs are
setup.

Reviewed-by: Laine Stump <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-08 12:19:39 +00:00
..
xml example: add ipv6 filters examples 2020-11-04 17:21:45 +01:00
meson.build meson: Add missing virt_install_dirs 2022-02-02 16:26:36 +01:00
nwfilter_dhcpsnoop.c lib: Use g_clear_pointer() more 2022-02-08 08:42:07 +01:00
nwfilter_dhcpsnoop.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
nwfilter_driver.c nwfilter: hold filter update lock when creating/deleting bindings 2022-03-08 12:19:39 +00:00
nwfilter_driver.h src/nwfilter: use #pragma once in headers 2019-06-19 17:12:30 +02:00
nwfilter_ebiptables_driver.c maint: remove unnecessary virutil.h includes 2022-02-03 14:10:04 +01:00
nwfilter_ebiptables_driver.h src/nwfilter: use #pragma once in headers 2019-06-19 17:12:30 +02:00
nwfilter_gentech_driver.c Switch away from virHashFree 2021-12-01 13:53:12 +01:00
nwfilter_gentech_driver.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
nwfilter_learnipaddr.c nwfilter: Avoid memory alignment issues 2022-03-07 10:31:23 +01:00
nwfilter_learnipaddr.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
nwfilter_tech_driver.h lib: Drop internal virXXXPtr typedefs 2021-04-13 17:00:38 +02:00
virtnwfilterd.init.in configure: Provide OpenRC scripts for sub-daemons 2019-12-16 10:11:22 +01:00
virtnwfilterd.service.in systemd: Use correct man page name in modular daemon service files 2022-02-01 13:20:11 +01:00