Remove: cfg_statetrack cfg_statetrackstop cfg_administrativestateste cfg_administrativestateget cfg_serviceload cfg_serviceunload Rev SO to 5.0.0 Signed-off-by: Steven Dake <sdake@xxxxxxxxxx> --- cts/agents/cpg_test_agent.c | 6 -- exec/cfg.c | 170 +----------------------------------------- include/corosync/cfg.h | 81 -------------------- include/corosync/ipc_cfg.h | 78 ++------------------ lib/cfg.c | 147 ------------------------------------- lib/libcfg.verso | 2 +- tools/corosync-cfgtool.c | 75 +------------------ tools/corosync-quorumtool.c | 1 - 8 files changed, 14 insertions(+), 546 deletions(-) diff --git a/cts/agents/cpg_test_agent.c b/cts/agents/cpg_test_agent.c index 79de0d3..e99f522 100644 --- a/cts/agents/cpg_test_agent.c +++ b/cts/agents/cpg_test_agent.c @@ -244,7 +244,6 @@ static void my_shutdown_callback (corosync_cfg_handle_t handle, static corosync_cfg_callbacks_t cfg_callbacks = { .corosync_cfg_shutdown_callback = my_shutdown_callback, - .corosync_cfg_state_track_callback = NULL, }; static cpg_callbacks_t callbacks = { .cpg_deliver_fn = delivery_callback, @@ -559,8 +558,6 @@ static void msg_blaster_zcb (int sock, char* num_to_send_str) send_some_more_messages_zcb (); } -static corosync_cfg_state_notification_t notification_buffer; - static int cfg_dispatch_wrapper_fn ( int fd, int revents, @@ -737,9 +734,6 @@ static void do_command (int sock, char* func, char*args[], int num_args) result = corosync_cfg_fd_get (cfg_handle, &cfg_fd); qb_log (LOG_INFO,"corosync_cfg_fd_get() == %d", result); - result = corosync_cfg_state_track (cfg_handle, 0, ¬ification_buffer); - qb_log (LOG_INFO,"corosync_cfg_state_track() == %d", result); - qb_loop_poll_add (ta_poll_handle_get(), QB_LOOP_MED, cfg_fd, diff --git a/exec/cfg.c b/exec/cfg.c index f195395..2fe6c97 100644 --- a/exec/cfg.c +++ b/exec/cfg.c @@ -137,30 +137,6 @@ static void message_handler_req_lib_cfg_ringreenable ( void *conn, const void *msg); -static void message_handler_req_lib_cfg_statetrack ( - void *conn, - const void *msg); - -static void message_handler_req_lib_cfg_statetrackstop ( - void *conn, - const void *msg); - -static void message_handler_req_lib_cfg_administrativestateset ( - void *conn, - const void *msg); - -static void message_handler_req_lib_cfg_administrativestateget ( - void *conn, - const void *msg); - -static void message_handler_req_lib_cfg_serviceload ( - void *conn, - const void *msg); - -static void message_handler_req_lib_cfg_serviceunload ( - void *conn, - const void *msg); - static void message_handler_req_lib_cfg_killnode ( void *conn, const void *msg); @@ -199,50 +175,26 @@ static struct corosync_lib_handler cfg_lib_engine[] = .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .lib_handler_fn = message_handler_req_lib_cfg_statetrack, - .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED - }, - { /* 3 */ - .lib_handler_fn = message_handler_req_lib_cfg_statetrackstop, - .flow_control = CS_LIB_FLOW_CONTROL_REQUIRED - }, - { /* 4 */ - .lib_handler_fn = message_handler_req_lib_cfg_administrativestateset, - .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED - }, - { /* 5 */ - .lib_handler_fn = message_handler_req_lib_cfg_administrativestateget, - .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED - }, - { /* 6 */ - .lib_handler_fn = message_handler_req_lib_cfg_serviceload, - .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED - }, - { /* 7 */ - .lib_handler_fn = message_handler_req_lib_cfg_serviceunload, - .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED - }, - { /* 8 */ .lib_handler_fn = message_handler_req_lib_cfg_killnode, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED }, - { /* 9 */ + { /* 3 */ .lib_handler_fn = message_handler_req_lib_cfg_tryshutdown, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED }, - { /* 10 */ + { /* 4 */ .lib_handler_fn = message_handler_req_lib_cfg_replytoshutdown, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED }, - { /* 11 */ + { /* 5 */ .lib_handler_fn = message_handler_req_lib_cfg_get_node_addrs, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED }, - { /* 12 */ + { /* 6 */ .lib_handler_fn = message_handler_req_lib_cfg_local_get, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED }, - { /* 13 */ + { /* 7 */ .lib_handler_fn = message_handler_req_lib_cfg_crypto_set, .flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED } @@ -682,118 +634,6 @@ static void message_handler_req_lib_cfg_ringreenable ( LEAVE(); } -static void message_handler_req_lib_cfg_statetrack ( - void *conn, - const void *msg) -{ - struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn); - struct res_lib_cfg_statetrack res_lib_cfg_statetrack; - - ENTER(); - - /* - * We only do shutdown tracking at the moment - */ - if (list_empty(&ci->list)) { - list_add(&ci->list, &trackers_list); - ci->tracker_conn = conn; - - if (shutdown_con) { - /* - * Shutdown already in progress, ask the newcomer's opinion - */ - ci->shutdown_reply = SHUTDOWN_REPLY_UNKNOWN; - shutdown_expected++; - send_test_shutdown(conn, NULL, CS_OK); - } - } - - res_lib_cfg_statetrack.header.size = sizeof(struct res_lib_cfg_statetrack); - res_lib_cfg_statetrack.header.id = MESSAGE_RES_CFG_STATETRACKSTART; - res_lib_cfg_statetrack.header.error = CS_OK; - - api->ipc_response_send(conn, &res_lib_cfg_statetrack, - sizeof(res_lib_cfg_statetrack)); - - LEAVE(); -} - -static void message_handler_req_lib_cfg_statetrackstop ( - void *conn, - const void *msg) -{ - struct cfg_info *ci = (struct cfg_info *)api->ipc_private_data_get (conn); -// struct req_lib_cfg_statetrackstop *req_lib_cfg_statetrackstop = (struct req_lib_cfg_statetrackstop *)message; - - ENTER(); - remove_ci_from_shutdown(ci); - LEAVE(); -} - -static void message_handler_req_lib_cfg_administrativestateset ( - void *conn, - const void *msg) -{ -// struct req_lib_cfg_administrativestateset *req_lib_cfg_administrativestateset = (struct req_lib_cfg_administrativestateset *)message; - - ENTER(); - LEAVE(); -} -static void message_handler_req_lib_cfg_administrativestateget ( - void *conn, - const void *msg) -{ -// struct req_lib_cfg_administrativestateget *req_lib_cfg_administrativestateget = (struct req_lib_cfg_administrativestateget *)message; - ENTER(); - LEAVE(); -} - -static void message_handler_req_lib_cfg_serviceload ( - void *conn, - const void *msg) -{ - const struct req_lib_cfg_serviceload *req_lib_cfg_serviceload = msg; - struct res_lib_cfg_serviceload res_lib_cfg_serviceload; - - ENTER(); - api->service_link_and_init ( - api, - (const char *)req_lib_cfg_serviceload->service_name, - req_lib_cfg_serviceload->service_ver); - - res_lib_cfg_serviceload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD; - res_lib_cfg_serviceload.header.size = sizeof (struct res_lib_cfg_serviceload); - res_lib_cfg_serviceload.header.error = CS_OK; - api->ipc_response_send ( - conn, - &res_lib_cfg_serviceload, - sizeof (struct res_lib_cfg_serviceload)); - LEAVE(); -} - -static void message_handler_req_lib_cfg_serviceunload ( - void *conn, - const void *msg) -{ - const struct req_lib_cfg_serviceunload *req_lib_cfg_serviceunload = msg; - struct res_lib_cfg_serviceunload res_lib_cfg_serviceunload; - - ENTER(); - api->service_unlink_and_exit ( - api, - (const char *)req_lib_cfg_serviceunload->service_name, - req_lib_cfg_serviceunload->service_ver); - res_lib_cfg_serviceunload.header.id = MESSAGE_RES_CFG_SERVICEUNLOAD; - res_lib_cfg_serviceunload.header.size = sizeof (struct res_lib_cfg_serviceunload); - res_lib_cfg_serviceunload.header.error = CS_OK; - api->ipc_response_send ( - conn, - &res_lib_cfg_serviceunload, - sizeof (struct res_lib_cfg_serviceunload)); - LEAVE(); -} - - static void message_handler_req_lib_cfg_killnode ( void *conn, const void *msg) diff --git a/include/corosync/cfg.h b/include/corosync/cfg.h index 903d1ef..0f556ba 100644 --- a/include/corosync/cfg.h +++ b/include/corosync/cfg.h @@ -40,48 +40,6 @@ typedef uint64_t corosync_cfg_handle_t; -typedef enum { - COROSYNC_CFG_ADMINISTRATIVETARGET_SERVICEUNIT = 0, - COROSYNC_CFG_ADMINISTRATIVETARGET_SERVICEGROUP = 1, - COROSYNC_CFG_ADMINISTRATIVETARGET_COMPONENTSERVICEINSTANCE = 2, - COROSYNC_CFG_ADMINISTRATIVETARGET_NODE = 3 -} corosync_cfg_administrative_target_t; - -typedef enum { - COROSYNC_CFG_ADMINISTRATIVESTATE_UNLOCKED = 0, - COROSYNC_CFG_ADMINISTRATIVESTATE_LOCKED = 1, - COROSYNC_CFG_ADMINISTRATIVESTATE_STOPPING = 2 -} corosync_cfg_administrative_state_t; - -typedef enum { - COROSYNC_CFG_OPERATIONALSTATE_ENABLED = 1, - COROSYNC_CFG_OPERATIONALSTATE_DISABLED = 2 -} corosync_cfg_operational_state_t; - -typedef enum { - COROSYNC_CFG_READINESSSTATE_OUTOFSERVICE = 1, - COROSYNC_CFG_READINESSSTATE_INSERVICE = 2, - COROSYNC_CFG_READINESSSTATE_STOPPING = 3 -} corosync_cfg_readiness_state_t; - -typedef enum { - COROSYNC_CFG_PRESENCESTATE_UNINSTANTIATED = 1, - COROSYNC_CFG_PRESENCESTATE_INSTANTIATING = 2, - COROSYNC_CFG_PRESENCESTATE_INSTANTIATED = 3, - COROSYNC_CFG_PRESENCESTATE_TERMINATING = 4, - COROSYNC_CFG_PRESENCESTATE_RESTARTING = 5, - COROSYNC_CFG_PRESENCESTATE_INSTANTIATION_FAILED = 6, - COROSYNC_CFG_PRESENCESTATE_TERMINATION_FAILED = 7 -} corosync_cfg_presence_state_t; - -typedef enum { - COROSYNC_CFG_STATETYPE_OPERATIONAL = 0, - COROSYNC_CFG_STATETYPE_ADMINISTRATIVE = 1, - COROSYNC_CFG_STATETYPE_READINESS = 2, - COROSYNC_CFG_STATETYPE_HA = 3, - COROSYNC_CFG_STATETYPE_PRESENCE = 4 -} corosync_cfg_state_type_t; - /** * Shutdown types. */ @@ -107,27 +65,11 @@ typedef enum { COROSYNC_CFG_SHUTDOWN_FLAG_YES = 1, } corosync_cfg_shutdown_reply_flags_t; -typedef struct { - cs_name_t name; - corosync_cfg_state_type_t state_type; - corosync_cfg_administrative_state_t administrative_state; -} corosync_cfg_state_notification_t; - -typedef struct { - uint32_t number_of_items; - corosync_cfg_state_notification_t *notification; -} corosync_cfg_state_notification_buffer_t; - -typedef void (*corosync_cfg_state_track_callback_t) ( - corosync_cfg_state_notification_buffer_t *notification_buffer, - cs_error_t error); - typedef void (*corosync_cfg_shutdown_callback_t) ( corosync_cfg_handle_t cfg_handle, corosync_cfg_shutdown_flags_t flags); typedef struct { - corosync_cfg_state_track_callback_t corosync_cfg_state_track_callback; corosync_cfg_shutdown_callback_t corosync_cfg_shutdown_callback; } corosync_cfg_callbacks_t; @@ -186,18 +128,6 @@ corosync_cfg_ring_reenable ( corosync_cfg_handle_t cfg_handle); cs_error_t -corosync_cfg_service_load ( - corosync_cfg_handle_t cfg_handle, - const char *service_name, - unsigned int service_ver); - -cs_error_t -corosync_cfg_service_unload ( - corosync_cfg_handle_t cfg_handle, - const char *service_name, - unsigned int service_ver); - -cs_error_t corosync_cfg_kill_node ( corosync_cfg_handle_t cfg_handle, unsigned int nodeid, @@ -215,17 +145,6 @@ corosync_cfg_replyto_shutdown ( corosync_cfg_shutdown_reply_flags_t flags); cs_error_t -corosync_cfg_state_track ( - corosync_cfg_handle_t cfg_handle, - uint8_t track_flags, - const corosync_cfg_state_notification_t *notification_buffer); - -cs_error_t -corosync_cfg_state_track_stop ( - corosync_cfg_handle_t cfg_handle); - - -cs_error_t corosync_cfg_get_node_addrs ( corosync_cfg_handle_t cfg_handle, int nodeid, diff --git a/include/corosync/ipc_cfg.h b/include/corosync/ipc_cfg.h index 43859cc..882ea7a 100644 --- a/include/corosync/ipc_cfg.h +++ b/include/corosync/ipc_cfg.h @@ -42,18 +42,12 @@ enum req_lib_cfg_types { MESSAGE_REQ_CFG_RINGSTATUSGET = 0, MESSAGE_REQ_CFG_RINGREENABLE = 1, - MESSAGE_REQ_CFG_STATETRACKSTART = 2, - MESSAGE_REQ_CFG_STATETRACKSTOP = 3, - MESSAGE_REQ_CFG_ADMINISTRATIVESTATESET = 4, - MESSAGE_REQ_CFG_ADMINISTRATIVESTATEGET = 5, - MESSAGE_REQ_CFG_SERVICELOAD = 6, - MESSAGE_REQ_CFG_SERVICEUNLOAD = 7, - MESSAGE_REQ_CFG_KILLNODE = 8, - MESSAGE_REQ_CFG_TRYSHUTDOWN = 9, - MESSAGE_REQ_CFG_REPLYTOSHUTDOWN = 10, - MESSAGE_REQ_CFG_GET_NODE_ADDRS = 11, - MESSAGE_REQ_CFG_LOCAL_GET = 12, - MESSAGE_REQ_CFG_CRYPTO_SET = 13 + MESSAGE_REQ_CFG_KILLNODE = 2, + MESSAGE_REQ_CFG_TRYSHUTDOWN = 3, + MESSAGE_REQ_CFG_REPLYTOSHUTDOWN = 4, + MESSAGE_REQ_CFG_GET_NODE_ADDRS = 5, + MESSAGE_REQ_CFG_LOCAL_GET = 6, + MESSAGE_REQ_CFG_CRYPTO_SET = 7 }; enum res_lib_cfg_types { @@ -74,46 +68,6 @@ enum res_lib_cfg_types { MESSAGE_RES_CFG_CRYPTO_SET = 14, }; -struct req_lib_cfg_statetrack { - struct qb_ipc_request_header header; - uint8_t track_flags; - corosync_cfg_state_notification_t *notification_buffer_address; -}; - -struct res_lib_cfg_statetrack { - struct qb_ipc_response_header header; -}; - -struct req_lib_cfg_statetrackstop { - struct qb_ipc_request_header header; -}; - -struct res_lib_cfg_statetrackstop { - struct qb_ipc_response_header header; -}; - -struct req_lib_cfg_administrativestateset { - struct qb_ipc_request_header header; - cs_name_t comp_name; - corosync_cfg_administrative_target_t administrative_target; - corosync_cfg_administrative_state_t administrative_state; -}; - -struct res_lib_cfg_administrativestateset { - struct qb_ipc_response_header header; -}; - -struct req_lib_cfg_administrativestateget { - struct qb_ipc_request_header header; - cs_name_t comp_name; - corosync_cfg_administrative_target_t administrative_target; - corosync_cfg_administrative_state_t administrative_state; -}; - -struct res_lib_cfg_administrativestateget { - struct qb_ipc_response_header header __attribute__((aligned(8))); -}; - struct req_lib_cfg_ringstatusget { struct qb_ipc_request_header header __attribute__((aligned(8))); }; @@ -133,26 +87,6 @@ struct res_lib_cfg_ringreenable { struct qb_ipc_response_header header __attribute__((aligned(8))); }; -struct req_lib_cfg_serviceload { - struct qb_ipc_response_header header __attribute__((aligned(8))); - char service_name[256] __attribute__((aligned(8))); - unsigned int service_ver; -}; - -struct res_lib_cfg_serviceload { - struct qb_ipc_response_header header __attribute__((aligned(8))); -}; - -struct req_lib_cfg_serviceunload { - struct qb_ipc_response_header header __attribute__((aligned(8))); - char service_name[256] __attribute__((aligned(8))); - unsigned int service_ver; -}; - -struct res_lib_cfg_serviceunload { - struct qb_ipc_response_header header __attribute__((aligned(8))); -}; - struct req_lib_cfg_killnode { struct qb_ipc_request_header header __attribute__((aligned(8))); unsigned int nodeid __attribute__((aligned(8))); diff --git a/lib/cfg.c b/lib/cfg.c index 7728b74..aeefc26 100644 --- a/lib/cfg.c +++ b/lib/cfg.c @@ -381,153 +381,6 @@ corosync_cfg_ring_reenable ( } cs_error_t -corosync_cfg_service_load ( - corosync_cfg_handle_t cfg_handle, - const char *service_name, - unsigned int service_ver) -{ - struct cfg_inst *cfg_inst; - struct req_lib_cfg_serviceload req_lib_cfg_serviceload; - struct res_lib_cfg_serviceload res_lib_cfg_serviceload; - cs_error_t error; - struct iovec iov; - - error = hdb_error_to_cs(hdb_handle_get (&cfg_hdb, cfg_handle, (void *)&cfg_inst)); - if (error != CS_OK) { - return (error); - } - - req_lib_cfg_serviceload.header.size = sizeof (struct req_lib_cfg_serviceload); - req_lib_cfg_serviceload.header.id = MESSAGE_REQ_CFG_SERVICELOAD; - memset (&req_lib_cfg_serviceload.service_name, 0, - sizeof (req_lib_cfg_serviceload.service_name)); - strncpy (req_lib_cfg_serviceload.service_name, service_name, - sizeof (req_lib_cfg_serviceload.service_name) - 1); - req_lib_cfg_serviceload.service_ver = service_ver; - - iov.iov_base = (void *)&req_lib_cfg_serviceload; - iov.iov_len = sizeof (req_lib_cfg_serviceload); - - error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c, - &iov, - 1, - &res_lib_cfg_serviceload, - sizeof (struct res_lib_cfg_serviceload), CS_IPC_TIMEOUT_MS)); - - (void)hdb_handle_put (&cfg_hdb, cfg_handle); - - return (error); -} - -cs_error_t -corosync_cfg_service_unload ( - corosync_cfg_handle_t cfg_handle, - const char *service_name, - unsigned int service_ver) -{ - struct cfg_inst *cfg_inst; - struct req_lib_cfg_serviceunload req_lib_cfg_serviceunload; - struct res_lib_cfg_serviceunload res_lib_cfg_serviceunload; - cs_error_t error; - struct iovec iov; - - error = hdb_error_to_cs(hdb_handle_get (&cfg_hdb, cfg_handle, (void *)&cfg_inst)); - if (error != CS_OK) { - return (error); - } - - req_lib_cfg_serviceunload.header.size = sizeof (struct req_lib_cfg_serviceunload); - req_lib_cfg_serviceunload.header.id = MESSAGE_REQ_CFG_SERVICEUNLOAD; - memset (&req_lib_cfg_serviceunload.service_name, 0, - sizeof (req_lib_cfg_serviceunload.service_name)); - strncpy (req_lib_cfg_serviceunload.service_name, service_name, - sizeof (req_lib_cfg_serviceunload.service_name) - 1); - req_lib_cfg_serviceunload.service_ver = service_ver; - - iov.iov_base = (void *)&req_lib_cfg_serviceunload; - iov.iov_len = sizeof (req_lib_cfg_serviceunload); - - error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c, - &iov, - 1, - &res_lib_cfg_serviceunload, - sizeof (struct res_lib_cfg_serviceunload), CS_IPC_TIMEOUT_MS)); - - (void)hdb_handle_put (&cfg_hdb, cfg_handle); - - return (error); -} -cs_error_t -corosync_cfg_state_track ( - corosync_cfg_handle_t cfg_handle, - uint8_t track_flags, - const corosync_cfg_state_notification_t *notification_buffer) -{ - struct cfg_inst *cfg_inst; - struct req_lib_cfg_statetrack req_lib_cfg_statetrack; - struct res_lib_cfg_statetrack res_lib_cfg_statetrack; - cs_error_t error; - struct iovec iov; - - req_lib_cfg_statetrack.header.size = sizeof (struct req_lib_cfg_statetrack); - req_lib_cfg_statetrack.header.id = MESSAGE_REQ_CFG_STATETRACKSTART; - req_lib_cfg_statetrack.track_flags = track_flags; - req_lib_cfg_statetrack.notification_buffer_address = (corosync_cfg_state_notification_t *)notification_buffer; - - error = hdb_error_to_cs(hdb_handle_get (&cfg_hdb, cfg_handle, - (void *)&cfg_inst)); - if (error != CS_OK) { - return (error); - } - - iov.iov_base = (void *)&req_lib_cfg_statetrack, - iov.iov_len = sizeof (struct req_lib_cfg_statetrack), - - error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c, - &iov, - 1, - &res_lib_cfg_statetrack, - sizeof (struct res_lib_cfg_statetrack), CS_IPC_TIMEOUT_MS)); - - (void)hdb_handle_put (&cfg_hdb, cfg_handle); - - return (error == CS_OK ? res_lib_cfg_statetrack.header.error : error); -} - -cs_error_t -corosync_cfg_state_track_stop ( - corosync_cfg_handle_t cfg_handle) -{ - struct cfg_inst *cfg_inst; - struct req_lib_cfg_statetrackstop req_lib_cfg_statetrackstop; - struct res_lib_cfg_statetrackstop res_lib_cfg_statetrackstop; - cs_error_t error; - struct iovec iov; - - error = hdb_error_to_cs (hdb_handle_get (&cfg_hdb, cfg_handle, - (void *)&cfg_inst)); - if (error != CS_OK) { - return (error); - } - - req_lib_cfg_statetrackstop.header.size = sizeof (struct req_lib_cfg_statetrackstop); - req_lib_cfg_statetrackstop.header.id = MESSAGE_REQ_CFG_STATETRACKSTOP; - - iov.iov_base = (void *)&req_lib_cfg_statetrackstop, - iov.iov_len = sizeof (struct req_lib_cfg_statetrackstop), - - error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c, - &iov, - 1, - &res_lib_cfg_statetrackstop, - sizeof (struct res_lib_cfg_statetrackstop), CS_IPC_TIMEOUT_MS)); - - (void)hdb_handle_put (&cfg_hdb, cfg_handle); - - return (error == CS_OK ? res_lib_cfg_statetrackstop.header.error : error); -} - -cs_error_t corosync_cfg_kill_node ( corosync_cfg_handle_t cfg_handle, unsigned int nodeid, diff --git a/lib/libcfg.verso b/lib/libcfg.verso index 1454f6e..0062ac9 100644 --- a/lib/libcfg.verso +++ b/lib/libcfg.verso @@ -1 +1 @@ -4.0.1 +5.0.0 diff --git a/tools/corosync-cfgtool.c b/tools/corosync-cfgtool.c index bb6f1ed..33918a1 100644 --- a/tools/corosync-cfgtool.c +++ b/tools/corosync-cfgtool.c @@ -123,42 +123,6 @@ static void ringreenable_do (void) (void)corosync_cfg_finalize (handle); } -static void service_load_do (const char *service, unsigned int version) -{ - cs_error_t result; - corosync_cfg_handle_t handle; - - printf ("Loading service '%s' version '%d'\n", service, version); - result = corosync_cfg_initialize (&handle, NULL); - if (result != CS_OK) { - printf ("Could not initialize corosync configuration API error %d\n", result); - exit (1); - } - result = corosync_cfg_service_load (handle, service, version); - if (result != CS_OK) { - printf ("Could not load service (error = %d)\n", result); - } - (void)corosync_cfg_finalize (handle); -} - -static void service_unload_do (const char *service, unsigned int version) -{ - cs_error_t result; - corosync_cfg_handle_t handle; - - printf ("Unloading service '%s' version '%d'\n", service, version); - result = corosync_cfg_initialize (&handle, NULL); - if (result != CS_OK) { - printf ("Could not initialize corosync configuration API error %d\n", result); - exit (1); - } - result = corosync_cfg_service_unload (handle, service, version); - if (result != CS_OK) { - printf ("Could not unload service (error = %d)\n", result); - } - (void)corosync_cfg_finalize (handle); -} - static void shutdown_do(void) { cs_error_t result; @@ -265,39 +229,22 @@ static void killnode_do(unsigned int nodeid) static void usage_do (void) { - printf ("corosync-cfgtool [[-i <interface ip>] -s] [-r] [-l] [-u] [-H] [service_name] [-v] [version] [-k] [nodeid] [-a] [nodeid]\n\n"); + printf ("corosync-cfgtool [-i <interface ip>] -s] [-r] [-H] [service_name] [-k] [nodeid] [-a] [nodeid]\n\n"); printf ("A tool for displaying and configuring active parameters within corosync.\n"); printf ("options:\n"); printf ("\t-s\tDisplays the status of the current rings on this node.\n"); printf ("\t-r\tReset redundant ring state cluster wide after a fault to\n"); printf ("\t\tre-enable redundant ring operation.\n"); - printf ("\t-l\tLoad a service identified by name.\n"); - printf ("\t-u\tUnload a service identified by name.\n"); printf ("\t-a\tDisplay the IP address(es) of a node\n"); printf ("\t-c\tSet the cryptography mode of cluster communications\n"); printf ("\t-k\tKill a node identified by node id.\n"); printf ("\t-H\tShutdown corosync cleanly on this node.\n"); } -static char * -xstrdup (char const *s) -{ - char *p = strdup (s); - if (p) - return (char *) p; - - printf ("exhausted virtual memory\n"); - exit (1); -} - int main (int argc, char *argv[]) { - const char *options = "i:srl:u:v:k:a:c:hH"; + const char *options = "i:srk:a:c:hH"; int opt; - int service_load = 0; unsigned int nodeid; - int service_unload = 0; - char *service = NULL; - unsigned int version = 0; char interface_name[128] = ""; int rc=0; @@ -315,14 +262,6 @@ int main (int argc, char *argv[]) { case 'r': ringreenable_do (); break; - case 'l': - service_load = 1; - service = xstrdup (optarg); - break; - case 'u': - service_unload = 1; - service = xstrdup (optarg); - break; case 'k': nodeid = atoi (optarg); killnode_do(nodeid); @@ -336,21 +275,11 @@ int main (int argc, char *argv[]) { case 'c': crypto_do( atoi(optarg) ); break; - case 'v': - version = atoi (optarg); - break; case 'h': usage_do(); break; } } - if (service_load) { - service_load_do (service, version); - } else - if (service_unload) { - service_unload_do (service, version); - } - return (rc); } diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c index 0f37d3e..0a21a3c 100644 --- a/tools/corosync-quorumtool.c +++ b/tools/corosync-quorumtool.c @@ -114,7 +114,6 @@ static votequorum_callbacks_t v_callbacks = { */ static corosync_cfg_handle_t c_handle; static corosync_cfg_callbacks_t c_callbacks = { - .corosync_cfg_state_track_callback = NULL, .corosync_cfg_shutdown_callback = NULL }; -- 1.7.7.6 _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss