summaryrefslogtreecommitdiff
path: root/ctdb/client
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-09-21 15:52:14 +1000
committerMartin Schwenke <martins@samba.org>2017-09-21 08:53:26 +0200
commitc6a35200f45b04e2e6f867743213f2d95eabef4f (patch)
treeeb63787a1191ea79202744ee40c6c451ce3bf901 /ctdb/client
parent02ae3d9fab6cdaaa1a2999a57a37ecc281f7f608 (diff)
downloadsamba-c6a35200f45b04e2e6f867743213f2d95eabef4f.tar.gz
ctdb-client: Add client code for control CHECK_PID_SRVID
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13042 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/client')
-rw-r--r--ctdb/client/client_control_sync.c29
-rw-r--r--ctdb/client/client_sync.h5
2 files changed, 34 insertions, 0 deletions
diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c
index 343d15dfd66..7ee9f1da4a0 100644
--- a/ctdb/client/client_control_sync.c
+++ b/ctdb/client/client_control_sync.c
@@ -2631,3 +2631,32 @@ int ctdb_ctrl_db_attach_replicated(TALLOC_CTX *mem_ctx,
return 0;
}
+
+int ctdb_ctrl_check_pid_srvid(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pid_srvid *pid_srvid, int *status)
+{
+ struct ctdb_req_control request;
+ struct ctdb_reply_control *reply;
+ int ret;
+
+ ctdb_req_control_check_pid_srvid(&request, pid_srvid);
+ ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
+ &request, &reply);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control CHECK_PID_SRVID failed to node %u, ret=%d\n",
+ destnode, ret));
+ return ret;
+ }
+
+ ret = ctdb_reply_control_check_pid_srvid(reply, status);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ ("Control CHECK_PID_SRVID failed, ret=%d\n", ret));
+ return ret;
+ }
+
+ return 0;
+}
diff --git a/ctdb/client/client_sync.h b/ctdb/client/client_sync.h
index 99a886ae050..c07edf6caf9 100644
--- a/ctdb/client/client_sync.h
+++ b/ctdb/client/client_sync.h
@@ -476,6 +476,11 @@ int ctdb_ctrl_db_attach_replicated(TALLOC_CTX *mem_ctx,
int destnode, struct timeval timeout,
const char *db_name, uint32_t *db_id);
+int ctdb_ctrl_check_pid_srvid(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+ struct ctdb_client_context *client,
+ int destnode, struct timeval timeout,
+ struct ctdb_pid_srvid *pid_srvid, int *status);
+
/* from client/client_message_sync.c */
int ctdb_message_recd_update_ip(TALLOC_CTX *mem_ctx, struct tevent_context *ev,