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 ced6a54..b0597ee 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -1214,10 +1214,7 @@ virConnectRegisterCloseCallback(virConnectPtr conn,
VIR_DEBUG("conn=%p", conn);
virResetLastError();
-
virCheckConnectReturn(conn, -1);
- virObjectLock(conn);
-
virCheckNonNullArgGoto(cb, error);
if (virConnectCloseCallbackDataGetCallback(conn->closeCallback) != NULL) {
@@ -1229,11 +1226,9 @@ virConnectRegisterCloseCallback(virConnectPtr conn,
virConnectCloseCallbackDataRegister(conn->closeCallback, conn, cb,
opaque, freecb);
- virObjectUnlock(conn);
return 0;
error:
- virObjectUnlock(conn);
virDispatchError(conn);
return -1;
}
@@ -1259,10 +1254,7 @@ virConnectUnregisterCloseCallback(virConnectPtr conn,
VIR_DEBUG("conn=%p", conn);
virResetLastError();
-
virCheckConnectReturn(conn, -1);
- virObjectLock(conn);
-
virCheckNonNullArgGoto(cb, error);
if (virConnectCloseCallbackDataGetCallback(conn->closeCallback) != cb) {
@@ -1273,11 +1265,9 @@ virConnectUnregisterCloseCallback(virConnectPtr conn,
virConnectCloseCallbackDataUnregister(conn->closeCallback, cb);
- virObjectUnlock(conn);
return 0;
error:
- virObjectUnlock(conn);
virDispatchError(conn);
return -1;
}
--
1.8.3.1