]> xenbits.xensource.com Git - libvirt.git/commit
daemon: fixup refcounting in close callback handling
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 3 Mar 2016 08:01:15 +0000 (11:01 +0300)
committerErik Skultety <eskultet@redhat.com>
Thu, 3 Mar 2016 10:02:11 +0000 (11:02 +0100)
commitce35122cfeb43c92d4cbea83530cd13144cd591c
tree75004467f95d44bd2e5f05a7852ce5a214298d6b
parent0b36b0e9ce83e8f96de27dffa90a0cb28cb229c9
daemon: fixup refcounting in close callback handling

remoteDispatchConnectCloseCallbackRegister introduced in
f484310a has problems. It refcounts network client object and in case of NOOP
driver operations for registering/unregistering close callback (any driver
except for vz) nobody will unref it later. As a result, client connection
will not be disposed and driver connection will not be closed.

The fix is easy. We don't need to refcount at all. We don't get a dangling
pointer because in remoteClientFreeFunc, which is called
upon disposing this network client object, we unregister the close
callback.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
daemon/remote.c