A deadlock occurs when `nwfilterBindingCreateXML` and 
`nwfilterConnectListAllNWFilters`
acquire locks in an inconsistent order. This affects both incoming migrations 
and
VM startups (`virsh start`), where `nwfilterBindingCreateXML` needs 
`updateLock`,
while `nwfilter-list` first acquires `driverMutex` and then locks individual 
filters.

This patch resolves the deadlock by ensuring `nwfilterBindingCreateXML` acquires
`driverMutex` before `updateLock`, following the locking pattern used by other
functions like `undefine` `nwfilterStateReload`.

Added the use of `driverMutex` in `nwfilterBindingDelete` to maintain
consistent locking order, as suggested.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/680

Dion Bosschieter (1):
  nwfilter: Fix deadlock between nwfilter-list and VM startup/migration

 src/nwfilter/nwfilter_driver.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

-- 
2.39.3 (Apple Git-146)

Reply via email to