return res;
}
+int ctdb_ctrl_get_runstate(struct ctdb_context *ctdb,
+ struct timeval timeout,
+ uint32_t destnode,
+ uint32_t *runstate)
+{
+ TDB_DATA outdata;
+ int32_t res;
+ int ret;
+
+ ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_GET_RUNSTATE, 0,
+ tdb_null, ctdb, &outdata, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ DEBUG(DEBUG_ERR,("ctdb_control for get_runstate failed\n"));
+ return ret != 0 ? ret : res;
+ }
+
+ if (outdata.dsize != sizeof(uint32_t)) {
+ DEBUG(DEBUG_ERR,("Invalid return data in get_runstate\n"));
+ talloc_free(outdata.dptr);
+ return -1;
+ }
+
+ if (runstate != NULL) {
+ *runstate = *(uint32_t *)outdata.dptr;
+ }
+ talloc_free(outdata.dptr);
+
+ return 0;
+}
+
/*
find the real path to a ltdb
*/
int ctdb_ctrl_ping(struct ctdb_context *ctdb, uint32_t destnode);
+int ctdb_ctrl_get_runstate(struct ctdb_context *ctdb,
+ struct timeval timeout,
+ uint32_t destnode,
+ uint32_t *runstate);
+
int ctdb_ctrl_get_config(struct ctdb_context *ctdb);
int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, int32_t *level);
CTDB_CONTROL_TRAVERSE_ALL_EXT = 135,
CTDB_CONTROL_RECEIVE_RECORDS = 136,
CTDB_CONTROL_IPREALLOCATED = 137,
+ CTDB_CONTROL_GET_RUNSTATE = 138,
};
/*
CHECK_CONTROL_DATA_SIZE(0);
return ctdb->num_clients;
+ case CTDB_CONTROL_GET_RUNSTATE:
+ CHECK_CONTROL_DATA_SIZE(0);
+ outdata->dptr = (uint8_t *)&ctdb->runstate;
+ outdata->dsize = sizeof(uint32_t);
+ return 0;
+
+
case CTDB_CONTROL_SET_DB_READONLY: {
uint32_t db_id;
struct ctdb_db_context *ctdb_db;