virNWFilterLockIface: Preserve correct lock ordering
virNWFilterLockIface: Preserve correct lock ordering

In the not so distant past, the lock ordering in
virNWFilterLockIface() was as follows: global mutex ifaceMapLock
was acquired, then internal representation of given interface was
looked up in a hash table (or created brand new if none was
found), the global lock was released and the lock of the
interface was acquired.

But this was mistakenly changed as the function was rewritten to
use automatic mutexes, because now the global lock is held
throughout the whole run of the function and thus the interface
specific lock is acquired with the global lock held. This results
in a deadlock.

Fixes: dd8150c48dcf94e8d3b0481be08eeef822b98b02
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Tested-by: Erik Skultety <2c14d38fa47c8799f1b9c16280abe27f8edfec6e@redhat.com>
Reviewed-by: Erik Skultety <2c14d38fa47c8799f1b9c16280abe27f8edfec6e@redhat.com>

olafhering/libvirt,libvirt/libvirt,zippy2/libvirt,crobinso/libvirt,libvirt/libvirt,crobinso/libvirt,jfehlig/libvirt,crobinso/libvirt,zippy2/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,zippy2/libvirt,olafhering/libvirt,crobinso/libvirt,olafhering/libvirt,libvirt/libvirt,jfehlig/libvirt,jfehlig/libvirt,jfehlig/libvirt