closeCallback pointer is immutable (set on connection object creation) and self-locking. --- src/libvirt-host.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/libvirt-host.c b/src/libvirt-host.c index c492bd8..0bab5f2 100644 --- a/src/libvirt-host.c +++ b/src/libvirt-host.c @@ -1214,21 +1214,16 @@ virConnectRegisterCloseCallback(virConnectPtr conn, VIR_DEBUG("conn=%p", conn); virResetLastError(); - virCheckConnectReturn(conn, -1); - virObjectLock(conn); - virCheckNonNullArgGoto(cb, error); if (virConnectCloseCallbackDataRegister(conn->closeCallback, conn, cb, opaque, freecb) < 0) goto error; - virObjectUnlock(conn); return 0; error: - virObjectUnlock(conn); virDispatchError(conn); return -1; } @@ -1254,20 +1249,15 @@ virConnectUnregisterCloseCallback(virConnectPtr conn, VIR_DEBUG("conn=%p", conn); virResetLastError(); - virCheckConnectReturn(conn, -1); - virObjectLock(conn); - virCheckNonNullArgGoto(cb, error); if (virConnectCloseCallbackDataUnregister(conn->closeCallback, cb) < 0) goto error; - virObjectUnlock(conn); return 0; error: - virObjectUnlock(conn); virDispatchError(conn); return -1; } -- 1.8.3.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list