ctdb-client: Add client code for control CHECK_PID_SRVID
authorAmitay Isaacs <amitay@gmail.com>
Thu, 21 Sep 2017 05:52:14 +0000 (15:52 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 21 Sep 2017 06:53:26 +0000 (08:53 +0200)
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>
ctdb/client/client_control_sync.c
ctdb/client/client_sync.h

index 343d15dfd661dec1c61f4a8b8667a61b08940361..7ee9f1da4a01cbdd06ee6d73f01df66fa74e5a92 100644 (file)
@@ -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;
+}
index 99a886ae050883dc6b81939e44240b8e30a5406f..c07edf6caf904ef22250f891f3ccee5461dc6259 100644 (file)
@@ -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,