]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: Avoid deadlock when closing client connection
authorJiri Denemark <jdenemar@redhat.com>
Mon, 18 Feb 2013 14:10:04 +0000 (15:10 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 19 Feb 2013 09:52:37 +0000 (10:52 +0100)
commit921af42980cb75e550d562654b2ad12b851b36cb
treeda3b3a99dddd39f3f78fdd51d549c85c62cfb984
parentee1d6d91d1fcf002914cf80fc8a59ddf107dd20f
rpc: Avoid deadlock when closing client connection

We need to drop the server lock before calling virObjectUnlock(client)
since in case we had the last reference to the client, its dispose
callback would be called and that could possibly try to lock the server
and cause a deadlock. This is exactly what happens when there is only
one QEMU domain running and it is marked to be autodestroyed when the
connection dies. This results in qemuProcessAutoDestroy ->
qemuProcessStop -> virNetServerRemoveShutdownInhibition call sequence,
where the last function locks the server.
src/rpc/virnetserver.c