There's no need to lock the network driver, as network driver initialization is done prior accepting any client. There's nobody to hop in and do something over partially initialized driver. Nor qemu driver is doing that. ==30532== Observed (incorrect) order is: acquisition of lock at 0x1439EF50 ==30532== at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0x5324895: virMutexLock (virthread.c:88) ==30532== by 0x5307E86: virObjectLock (virobject.c:323) ==30532== by 0x5396440: virNetworkObjListForEach (network_conf.c:4511) ==30532== by 0x19B29308: networkStateInitialize (bridge_driver.c:686) ==30532== by 0x53E1CCC: virStateInitialize (libvirt.c:777) ==30532== by 0x11DEB7: daemonRunStateInit (libvirtd.c:906) ==30532== by 0x5324B6A: virThreadHelper (virthread.c:197) ==30532== by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so) ==30532== by 0xA4EDC8C: clone (in /lib64/libc-2.19.so) ==30532== ==30532== followed by a later acquisition of lock at 0x1439CD60 ==30532== at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0x5324895: virMutexLock (virthread.c:88) ==30532== by 0x19B27B2C: networkDriverLock (bridge_driver.c:102) ==30532== by 0x19B27B60: networkGetDnsmasqCaps (bridge_driver.c:113) ==30532== by 0x19B2856A: networkUpdateState (bridge_driver.c:389) ==30532== by 0x53963E9: virNetworkObjListForEachHelper (network_conf.c:4488) ==30532== by 0x52E2224: virHashForEach (virhash.c:521) ==30532== by 0x539645B: virNetworkObjListForEach (network_conf.c:4512) ==30532== by 0x19B29308: networkStateInitialize (bridge_driver.c:686) ==30532== by 0x53E1CCC: virStateInitialize (libvirt.c:777) ==30532== by 0x11DEB7: daemonRunStateInit (libvirtd.c:906) ==30532== by 0x5324B6A: virThreadHelper (virthread.c:197) ==30532== ==30532== Required order was established by acquisition of lock at 0x1439CD60 ==30532== at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0x5324895: virMutexLock (virthread.c:88) ==30532== by 0x19B27B2C: networkDriverLock (bridge_driver.c:102) ==30532== by 0x19B28DF9: networkStateInitialize (bridge_driver.c:609) ==30532== by 0x53E1CCC: virStateInitialize (libvirt.c:777) ==30532== by 0x11DEB7: daemonRunStateInit (libvirtd.c:906) ==30532== by 0x5324B6A: virThreadHelper (virthread.c:197) ==30532== by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so) ==30532== by 0xA4EDC8C: clone (in /lib64/libc-2.19.so) ==30532== ==30532== followed by a later acquisition of lock at 0x1439EF50 ==30532== at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0x5324895: virMutexLock (virthread.c:88) ==30532== by 0x5307E86: virObjectLock (virobject.c:323) ==30532== by 0x538A09C: virNetworkAssignDef (network_conf.c:527) ==30532== by 0x5391EB2: virNetworkLoadState (network_conf.c:3008) ==30532== by 0x53922D4: virNetworkLoadAllState (network_conf.c:3128) ==30532== by 0x19B2929A: networkStateInitialize (bridge_driver.c:671) ==30532== by 0x53E1CCC: virStateInitialize (libvirt.c:777) ==30532== by 0x11DEB7: daemonRunStateInit (libvirtd.c:906) ==30532== by 0x5324B6A: virThreadHelper (virthread.c:197) ==30532== by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) ==30532== by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so) Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> --- src/network/bridge_driver.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a007388..b3dcadc 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -606,7 +606,6 @@ networkStateInitialize(bool privileged, VIR_FREE(network_driver); goto error; } - networkDriverLock(network_driver); /* configuration/state paths are one of * ~/.config/libvirt/... (session/unprivileged) @@ -677,8 +676,6 @@ networkStateInitialize(bool privileged, network_driver->networkAutostartDir) < 0) goto error; - networkDriverUnlock(network_driver); - /* Update the internal status of all allegedly active * networks according to external conditions on the host * (i.e. anything that isn't stored directly in each -- 2.0.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list