Re: [PATCH] Change all ais references to corosync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



and with the power invested in me by.... no wait.. wrong process..

ACK

Fabio

On 1/11/2012 3:50 PM, Steven Dake wrote:
> Signed-off-by: Steven Dake <sdake@xxxxxxxxxx>
> ---
>  INSTALL               |    6 +-
>  SECURITY              |   10 ++--
>  conf/COROSYNC-MIB.txt |    2 +-
>  exec/coroparse.c      |    6 +-
>  exec/fsm.h            |    4 +-
>  exec/ipc_glue.c       |   18 +++---
>  exec/main.c           |  138 ++++++++++++++++++++++++------------------------
>  exec/mainconfig.h     |    2 +-
>  exec/service.c        |   38 +++++++-------
>  exec/service.h        |    4 +-
>  exec/totemudp.c       |    3 +-
>  exec/totemudpu.c      |    3 +-
>  exec/util.c           |    6 +-
>  exec/util.h           |   44 ++++++++--------
>  lib/util.h            |    6 +-
>  15 files changed, 144 insertions(+), 146 deletions(-)
> 
> diff --git a/INSTALL b/INSTALL
> index 53a8230..b9dba63 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -238,9 +238,9 @@ First generate the key on one of the nodes:
>  balance# corosync-keygen
>  Corosync Authentication key generator.
>  Gathering 1024 bits for key from /dev/random.
> -Writing corosync key to /etc/ais/authkey.
> +Writing corosync key to /etc/corosync/authkey.
>  
> -After this is complete, a private key will be in the file /etc/ais/authkey.
> +After this is complete, a private key will be in the file /etc/corosync/authkey.
>  This private key must be copied to every processor that will be a member of
>  the cluster.  If the private key isn't the same for every node, those nodes
>  with nonmatching private keys will not be able to join the same configuration.
> @@ -248,7 +248,7 @@ with nonmatching private keys will not be able to join the same configuration.
>  Copy the key to some transportable storage or use ssh to transmit the key
>  from node to node.  Then install the key with the command:
>  
> -balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
> +balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey
>  
>  If the message invalid digest appears, the keys are not the same on each node.
>  
> diff --git a/SECURITY b/SECURITY
> index 30c9d1e..340910e 100644
> --- a/SECURITY
> +++ b/SECURITY
> @@ -20,7 +20,7 @@ The corosync project does not intend to mitigate the following threats:
>  
>  1. physical access to the hardware which could expose the private key
>  2. privledged access to the operating system which could expose the private key
> -   or be used to inject errors into the ais executive.
> +   or be used to inject errors into the corosync executive.
>  3. library user creates requests which are intended to fault the corosync
>     executive
>  
> @@ -32,11 +32,11 @@ The corosync project mitigates the threats using two mechanisms:
>  Library Interface
>  -----------------
>  The corosync executive authenticates every library user.  The library is only
> -allowed to access services if it's GID is ais or 0.  Unauthorized library
> +allowed to access services if it's GID is corosync or 0.  Unauthorized library
>  users are rejected.
>  
> -The ais group is a trusted group.  If the administrator doesn't trust the
> -application, it should not be added to the group!  Any member of the ais group
> +The corosync group is a trusted group.  If the administrator doesn't trust the
> +application, it should not be added to the group!  Any member of the corosync group
>  could potentially send a malformed request to the executive and cause it to
>  fault.
>  
> @@ -184,4 +184,4 @@ Once all nodes are using libnss encryption, the option should be set in
>  in corosync.conf so that it takes effect at the next system reboot.
>  
>  
> -Comments welcome mailto:corosync@xxxxxxxxxxxxxx
> +Comments welcome mailto:discuss@xxxxxxxxxxxx
> diff --git a/conf/COROSYNC-MIB.txt b/conf/COROSYNC-MIB.txt
> index feb7d7d..a1bab08 100644
> --- a/conf/COROSYNC-MIB.txt
> +++ b/conf/COROSYNC-MIB.txt
> @@ -16,7 +16,7 @@ corosync MODULE-IDENTITY
>      LAST-UPDATED    "201101211300Z"
>      ORGANIZATION    "www.corosync.org"
>      CONTACT-INFO    "name:  Yuki Sato
> -                     email: openais@xxxxxxxxxxxxxxxxxxxxxxxxxx"
> +                     email: discuss@xxxxxxxxxxxx"
>      DESCRIPTION     "Add cluster quorum traps, fix smilint errors, and fix notification block ID"
>      REVISION        "201101211300Z"
>      DESCRIPTION     "MIB objects for Corosync"
> diff --git a/exec/coroparse.c b/exec/coroparse.c
> index 7a2078b..e84e6f2 100644
> --- a/exec/coroparse.c
> +++ b/exec/coroparse.c
> @@ -147,7 +147,7 @@ static int uid_determine (const char *req_user)
>  
>  static int gid_determine (const char *req_group)
>  {
> -	int ais_gid = 0;
> +	int corosync_gid = 0;
>  	struct group group;
>  	struct group * grpptr = &group;
>  	struct group * temp_grp_pt;
> @@ -168,10 +168,10 @@ static int gid_determine (const char *req_group)
>  	                req_group);
>  		return (-1);
>  	}
> -	ais_gid = group.gr_gid;
> +	corosync_gid = group.gr_gid;
>  	free (grpbuffer);
>  
> -	return ais_gid;
> +	return corosync_gid;
>  }
>  static char *strchr_rs (const char *haystack, int byte)
>  {
> diff --git a/exec/fsm.h b/exec/fsm.h
> index 6f36362..f0a737e 100644
> --- a/exec/fsm.h
> +++ b/exec/fsm.h
> @@ -83,7 +83,7 @@ static inline void cs_fsm_process (struct cs_fsm *fsm, int32_t new_event, void *
>  	}
>  	log_printf (LOGSYS_LEVEL_ERROR, "Fsm:%s could not find event \"%s\" in state \"%s\"",
>  		fsm->name, fsm->event_to_str(fsm, new_event), fsm->state_to_str(fsm, fsm->curr_state));
> -	corosync_exit_error(AIS_DONE_FATAL_ERR);
> +	corosync_exit_error(COROSYNC_DONE_FATAL_ERR);
>  }
>  
>  static inline void cs_fsm_state_set (struct cs_fsm* fsm, int32_t next_state, void* data)
> @@ -116,7 +116,7 @@ static inline void cs_fsm_state_set (struct cs_fsm* fsm, int32_t next_state, voi
>  		fsm->state_to_str(fsm, fsm->table[fsm->curr_entry].curr_state),
>  		fsm->state_to_str(fsm, next_state),
>  		fsm->event_to_str(fsm, entry->event));
> -	corosync_exit_error(AIS_DONE_FATAL_ERR);
> +	corosync_exit_error(COROSYNC_DONE_FATAL_ERR);
>  }
>  
>  #endif /* FSM_H_DEFINED */
> diff --git a/exec/ipc_glue.c b/exec/ipc_glue.c
> index 9a5d06d..5f5951f 100644
> --- a/exec/ipc_glue.c
> +++ b/exec/ipc_glue.c
> @@ -210,8 +210,8 @@ static int32_t cs_ipcs_connection_accept (qb_ipcs_connection_t *c, uid_t euid, g
>  	uint8_t u8;
>  	char key_name[ICMAP_KEYNAME_MAXLEN];
>  
> -	if (ais_service[service] == NULL ||
> -		ais_service_exiting[service] ||
> +	if (corosync_service[service] == NULL ||
> +		corosync_service_exiting[service] ||
>  		ipcs_mapper[service].inst == NULL) {
>  		return -ENOSYS;
>  	}
> @@ -307,7 +307,7 @@ static void cs_ipcs_connection_created(qb_ipcs_connection_t *c)
>  
>  	service = qb_ipcs_service_id_get(c);
>  
> -	size += ais_service[service]->private_data_size;
> +	size += corosync_service[service]->private_data_size;
>  	context = calloc(1, size);
>  
>  	list_init(&context->outq_head);
> @@ -317,7 +317,7 @@ static void cs_ipcs_connection_created(qb_ipcs_connection_t *c)
>  
>  	qb_ipcs_context_set(c, context);
>  
> -	ais_service[service]->lib_init_fn(c);
> +	corosync_service[service]->lib_init_fn(c);
>  
>  	icmap_inc("runtime.connections.active");
>  
> @@ -441,7 +441,7 @@ static int32_t cs_ipcs_connection_closed (qb_ipcs_connection_t *c)
>  	struct cs_ipcs_conn_context *cnx;
>  
>  	log_printf(LOG_DEBUG, "%s() ", __func__);
> -	res = ais_service[service]->lib_exit_fn(c);
> +	res = corosync_service[service]->lib_exit_fn(c);
>  	if (res != 0) {
>  		return res;
>  	}
> @@ -658,7 +658,7 @@ static int32_t cs_ipcs_msg_process(qb_ipcs_connection_t *c,
>  	}
>  
>  	if (send_ok) {
> -		ais_service[service]->lib_engine[request_pt->id].lib_handler_fn(c, request_pt);
> +		corosync_service[service]->lib_engine[request_pt->id].lib_handler_fn(c, request_pt);
>  		res = 0;
>  	}
>  	corosync_sending_allowed_release (&sending_allowed_private_data);
> @@ -713,12 +713,12 @@ static void cs_ipcs_check_for_flow_control(void)
>  	int32_t fc_enabled;
>  
>  	for (i = 0; i < SERVICE_HANDLER_MAXIMUM_COUNT; i++) {
> -		if (ais_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
> +		if (corosync_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
>  			continue;
>  		}
>  		fc_enabled = QB_IPCS_RATE_OFF;
>  		if (ipc_fc_is_quorate == 1 ||
> -			ais_service[i]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
> +			corosync_service[i]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
>  			/*
>  			 * we are quorate
>  			 * now check flow control
> @@ -773,7 +773,7 @@ void cs_ipcs_stats_update(void)
>  	char key_name[ICMAP_KEYNAME_MAXLEN];
>  
>  	for (i = 0; i < SERVICE_HANDLER_MAXIMUM_COUNT; i++) {
> -		if (ais_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
> +		if (corosync_service[i] == NULL || ipcs_mapper[i].inst == NULL) {
>  			continue;
>  		}
>  		qb_ipcs_stats_get(ipcs_mapper[i].inst, &srv_stats, QB_FALSE);
> diff --git a/exec/main.c b/exec/main.c
> index 6c1ea35..a39fb83 100644
> --- a/exec/main.c
> +++ b/exec/main.c
> @@ -192,8 +192,8 @@ void corosync_state_dump (void)
>  	int i;
>  
>  	for (i = 0; i < SERVICE_HANDLER_MAXIMUM_COUNT; i++) {
> -		if (ais_service[i] && ais_service[i]->exec_dump_fn) {
> -			ais_service[i]->exec_dump_fn ();
> +		if (corosync_service[i] && corosync_service[i]->exec_dump_fn) {
> +			corosync_service[i]->exec_dump_fn ();
>  		}
>  	}
>  }
> @@ -267,17 +267,17 @@ static void corosync_sync_completed (void)
>  static int corosync_sync_callbacks_retrieve (int sync_id,
>  	struct sync_callbacks *callbacks)
>  {
> -	unsigned int ais_service_index;
> +	unsigned int corosync_service_index;
>  	int res;
>  
> -	for (ais_service_index = 0;
> -		ais_service_index < SERVICE_HANDLER_MAXIMUM_COUNT;
> -		ais_service_index++) {
> +	for (corosync_service_index = 0;
> +		corosync_service_index < SERVICE_HANDLER_MAXIMUM_COUNT;
> +		corosync_service_index++) {
>  
> -		if (ais_service[ais_service_index] != NULL
> -			&& (ais_service[ais_service_index]->sync_mode == CS_SYNC_V1
> -				|| ais_service[ais_service_index]->sync_mode == CS_SYNC_V1_APIV2)) {
> -			if (ais_service_index == sync_id) {
> +		if (corosync_service[corosync_service_index] != NULL
> +			&& (corosync_service[corosync_service_index]->sync_mode == CS_SYNC_V1
> +				|| corosync_service[corosync_service_index]->sync_mode == CS_SYNC_V1_APIV2)) {
> +			if (corosync_service_index == sync_id) {
>  				break;
>  			}
>  		}
> @@ -285,19 +285,19 @@ static int corosync_sync_callbacks_retrieve (int sync_id,
>  	/*
>  	 * Try to load backwards compat sync engines
>  	 */
> -	if (ais_service_index == SERVICE_HANDLER_MAXIMUM_COUNT) {
> +	if (corosync_service_index == SERVICE_HANDLER_MAXIMUM_COUNT) {
>  		res = evil_callbacks_load (sync_id, callbacks);
>  		return (res);
>  	}
> -	callbacks->name = ais_service[ais_service_index]->name;
> -	callbacks->sync_init_api.sync_init_v1 = ais_service[ais_service_index]->sync_init;
> +	callbacks->name = corosync_service[corosync_service_index]->name;
> +	callbacks->sync_init_api.sync_init_v1 = corosync_service[corosync_service_index]->sync_init;
>  	callbacks->api_version = 1;
> -	if (ais_service[ais_service_index]->sync_mode == CS_SYNC_V1_APIV2) {
> +	if (corosync_service[corosync_service_index]->sync_mode == CS_SYNC_V1_APIV2) {
>  		callbacks->api_version = 2;
>  	}
> -	callbacks->sync_process = ais_service[ais_service_index]->sync_process;
> -	callbacks->sync_activate = ais_service[ais_service_index]->sync_activate;
> -	callbacks->sync_abort = ais_service[ais_service_index]->sync_abort;
> +	callbacks->sync_process = corosync_service[corosync_service_index]->sync_process;
> +	callbacks->sync_activate = corosync_service[corosync_service_index]->sync_activate;
> +	callbacks->sync_abort = corosync_service[corosync_service_index]->sync_abort;
>  	return (0);
>  }
>  
> @@ -307,32 +307,32 @@ static int corosync_sync_v2_callbacks_retrieve (
>  {
>  	int res;
>  
> -	if (minimum_sync_mode == CS_SYNC_V2 && service_id == CLM_SERVICE && ais_service[CLM_SERVICE] == NULL) {
> +	if (minimum_sync_mode == CS_SYNC_V2 && service_id == CLM_SERVICE && corosync_service[CLM_SERVICE] == NULL) {
>  		res = evil_callbacks_load (service_id, callbacks);
>  		return (res);
>  	}
> -	if (minimum_sync_mode == CS_SYNC_V2 && service_id == EVT_SERVICE && ais_service[EVT_SERVICE] == NULL) {
> +	if (minimum_sync_mode == CS_SYNC_V2 && service_id == EVT_SERVICE && corosync_service[EVT_SERVICE] == NULL) {
>  		res = evil_callbacks_load (service_id, callbacks);
>  		return (res);
>  	}
> -	if (ais_service[service_id] == NULL) {
> +	if (corosync_service[service_id] == NULL) {
>  		return (-1);
>  	}
> -	if (minimum_sync_mode == CS_SYNC_V1 && ais_service[service_id]->sync_mode != CS_SYNC_V2) {
> +	if (minimum_sync_mode == CS_SYNC_V1 && corosync_service[service_id]->sync_mode != CS_SYNC_V2) {
>  		return (-1);
>  	}
>  
> -	callbacks->name = ais_service[service_id]->name;
> +	callbacks->name = corosync_service[service_id]->name;
>  
>  	callbacks->api_version = 1;
> -	if (ais_service[service_id]->sync_mode == CS_SYNC_V1_APIV2) {
> +	if (corosync_service[service_id]->sync_mode == CS_SYNC_V1_APIV2) {
>  		callbacks->api_version = 2;
>  	}
>  
> -	callbacks->sync_init_api.sync_init_v1 = ais_service[service_id]->sync_init;
> -	callbacks->sync_process = ais_service[service_id]->sync_process;
> -	callbacks->sync_activate = ais_service[service_id]->sync_activate;
> -	callbacks->sync_abort = ais_service[service_id]->sync_abort;
> +	callbacks->sync_init_api.sync_init_v1 = corosync_service[service_id]->sync_init;
> +	callbacks->sync_process = corosync_service[service_id]->sync_process;
> +	callbacks->sync_activate = corosync_service[service_id]->sync_activate;
> +	callbacks->sync_abort = corosync_service[service_id]->sync_abort;
>  	return (0);
>  }
>  
> @@ -393,8 +393,8 @@ static void confchg_fn (
>  	 * Call configuration change for all services
>  	 */
>  	for (i = 0; i < service_count; i++) {
> -		if (ais_service[i] && ais_service[i]->confchg_fn) {
> -			ais_service[i]->confchg_fn (configuration_type,
> +		if (corosync_service[i] && corosync_service[i]->confchg_fn) {
> +			corosync_service[i]->confchg_fn (configuration_type,
>  				member_list, member_list_entries,
>  				left_list, left_list_entries,
>  				joined_list, joined_list_entries, ring_id);
> @@ -427,7 +427,7 @@ static void corosync_tty_detach (void)
>  
>  	switch (fork ()) {
>  		case -1:
> -			corosync_exit_error (AIS_DONE_FORK);
> +			corosync_exit_error (COROSYNC_DONE_FORK);
>  			break;
>  		case 0:
>  			/*
> @@ -447,15 +447,15 @@ static void corosync_tty_detach (void)
>  	 */
>  	r = freopen("/dev/null", "r", stdin);
>  	if (r == NULL) {
> -		corosync_exit_error (AIS_DONE_STD_TO_NULL_REDIR);
> +		corosync_exit_error (COROSYNC_DONE_STD_TO_NULL_REDIR);
>  	}
>  	r = freopen("/dev/null", "a", stderr);
>  	if (r == NULL) {
> -		corosync_exit_error (AIS_DONE_STD_TO_NULL_REDIR);
> +		corosync_exit_error (COROSYNC_DONE_STD_TO_NULL_REDIR);
>  	}
>  	r = freopen("/dev/null", "a", stdout);
>  	if (r == NULL) {
> -		corosync_exit_error (AIS_DONE_STD_TO_NULL_REDIR);
> +		corosync_exit_error (COROSYNC_DONE_STD_TO_NULL_REDIR);
>  	}
>  }
>  
> @@ -672,29 +672,29 @@ static void deliver_fn (
>  	service = id >> 16;
>  	fn_id = id & 0xffff;
>  
> -	if (ais_service[service] == NULL && service == EVT_SERVICE) {
> +	if (corosync_service[service] == NULL && service == EVT_SERVICE) {
>  		evil_deliver_fn (nodeid, service, fn_id, msg,
>  			endian_conversion_required);
>  	}
>  
> -	if (!ais_service[service]) {
> +	if (!corosync_service[service]) {
>  		return;
>  	}
> -	if (fn_id >= ais_service[service]->exec_engine_count) {
> +	if (fn_id >= corosync_service[service]->exec_engine_count) {
>  		log_printf(LOGSYS_LEVEL_WARNING, "discarded unknown message %d for service %d (max id %d)",
> -			fn_id, service, ais_service[service]->exec_engine_count);
> +			fn_id, service, corosync_service[service]->exec_engine_count);
>  		return;
>  	}
>  
>  	icmap_inc(service_stats_rx[service][fn_id]);
>  
>  	if (endian_conversion_required) {
> -		assert(ais_service[service]->exec_engine[fn_id].exec_endian_convert_fn != NULL);
> -		ais_service[service]->exec_engine[fn_id].exec_endian_convert_fn
> +		assert(corosync_service[service]->exec_engine[fn_id].exec_endian_convert_fn != NULL);
> +		corosync_service[service]->exec_engine[fn_id].exec_endian_convert_fn
>  			((void *)msg);
>  	}
>  
> -	ais_service[service]->exec_engine[fn_id].exec_handler_fn
> +	corosync_service[service]->exec_engine[fn_id].exec_handler_fn
>  		(msg, nodeid);
>  }
>  
> @@ -716,7 +716,7 @@ int main_mcast (
>  	service = req->id >> 16;
>  	fn_id = req->id & 0xffff;
>  
> -	if (ais_service[service]) {
> +	if (corosync_service[service]) {
>  		icmap_inc(service_stats_tx[service][fn_id]);
>  	}
>  
> @@ -762,10 +762,10 @@ int corosync_sending_allowed (
>  
>  	sending_allowed = QB_FALSE;
>  	if (corosync_quorum_is_quorate() == 1 ||
> -	    ais_service[service]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
> +	    corosync_service[service]->allow_inquorate == CS_LIB_ALLOW_INQUORATE) {
>  		// we are quorate
>  		// now check flow control
> -		if (ais_service[service]->lib_engine[id].flow_control == CS_LIB_FLOW_CONTROL_NOT_REQUIRED) {
> +		if (corosync_service[service]->lib_engine[id].flow_control == CS_LIB_FLOW_CONTROL_NOT_REQUIRED) {
>  			sending_allowed = QB_TRUE;
>  		} else if (pd->reserved_msgs && sync_in_process == 0) {
>  			sending_allowed = QB_TRUE;
> @@ -845,7 +845,7 @@ static void corosync_setscheduler (void)
>  				log_printf (LOGSYS_LEVEL_ERROR,
>  					    "Could not set logsys thread priority."
>  					    " Can't continue because of priority inversions.");
> -				corosync_exit_error (AIS_DONE_LOGSETUP);
> +				corosync_exit_error (COROSYNC_DONE_LOGSETUP);
>  			}
>  		}
>  	} else {
> @@ -927,7 +927,7 @@ static void main_service_ready (void)
>  	res = corosync_service_defaults_link_and_init (api);
>  	if (res == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Could not initialize default services\n");
> -		corosync_exit_error (AIS_DONE_INIT_SERVICES);
> +		corosync_exit_error (COROSYNC_DONE_INIT_SERVICES);
>  	}
>  	evil_init (api);
>  	cs_ipcs_init();
> @@ -956,20 +956,20 @@ static void main_service_ready (void)
>  
>  }
>  
> -static enum e_ais_done corosync_flock (const char *lockfile, pid_t pid)
> +static enum e_corosync_done corosync_flock (const char *lockfile, pid_t pid)
>  {
>  	struct flock lock;
> -	enum e_ais_done err;
> +	enum e_corosync_done err;
>  	char pid_s[17];
>  	int fd_flag;
>  	int lf;
>  
> -	err = AIS_DONE_EXIT;
> +	err = COROSYNC_DONE_EXIT;
>  
>  	lf = open (lockfile, O_WRONLY | O_CREAT, 0640);
>  	if (lf == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't create lock file.\n");
> -		return (AIS_DONE_AQUIRE_LOCK);
> +		return (COROSYNC_DONE_AQUIRE_LOCK);
>  	}
>  
>  retry_fcntl:
> @@ -985,13 +985,13 @@ retry_fcntl:
>  		case EAGAIN:
>  		case EACCES:
>  			log_printf (LOGSYS_LEVEL_ERROR, "Another Corosync instance is already running.\n");
> -			err = AIS_DONE_ALREADY_RUNNING;
> +			err = COROSYNC_DONE_ALREADY_RUNNING;
>  			goto error_close;
>  			break;
>  		default:
>  			log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't aquire lock. Error was %s\n",
>  			    strerror(errno));
> -			err = AIS_DONE_AQUIRE_LOCK;
> +			err = COROSYNC_DONE_AQUIRE_LOCK;
>  			goto error_close;
>  			break;
>  		}
> @@ -1000,7 +1000,7 @@ retry_fcntl:
>  	if (ftruncate (lf, 0) == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't truncate lock file. Error was %s\n",
>  		    strerror (errno));
> -		err = AIS_DONE_AQUIRE_LOCK;
> +		err = COROSYNC_DONE_AQUIRE_LOCK;
>  		goto error_close_unlink;
>  	}
>  
> @@ -1014,7 +1014,7 @@ retry_write:
>  		} else {
>  			log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't write pid to lock file. "
>  				"Error was %s\n", strerror (errno));
> -			err = AIS_DONE_AQUIRE_LOCK;
> +			err = COROSYNC_DONE_AQUIRE_LOCK;
>  			goto error_close_unlink;
>  		}
>  	}
> @@ -1022,14 +1022,14 @@ retry_write:
>  	if ((fd_flag = fcntl (lf, F_GETFD, 0)) == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't get close-on-exec flag from lock file. "
>  			"Error was %s\n", strerror (errno));
> -		err = AIS_DONE_AQUIRE_LOCK;
> +		err = COROSYNC_DONE_AQUIRE_LOCK;
>  		goto error_close_unlink;
>  	}
>  	fd_flag |= FD_CLOEXEC;
>  	if (fcntl (lf, F_SETFD, fd_flag) == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't set close-on-exec flag to lock file. "
>  			"Error was %s\n", strerror (errno));
> -		err = AIS_DONE_AQUIRE_LOCK;
> +		err = COROSYNC_DONE_AQUIRE_LOCK;
>  		goto error_close_unlink;
>  	}
>  
> @@ -1059,7 +1059,7 @@ int main (int argc, char **argv, char **envp)
>  	int background, setprio;
>  	struct stat stat_out;
>  	char corosync_lib_dir[PATH_MAX];
> -	enum e_ais_done flock_err;
> +	enum e_corosync_done flock_err;
>  
>  	/* default configuration
>  	 */
> @@ -1127,7 +1127,7 @@ int main (int argc, char **argv, char **envp)
>  
>  	if (icmap_init() != CS_OK) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't initialize configuration component.\n");
> -		corosync_exit_error (AIS_DONE_OBJDB);
> +		corosync_exit_error (COROSYNC_DONE_OBJDB);
>  	}
>  
>  	/*
> @@ -1150,7 +1150,7 @@ int main (int argc, char **argv, char **envp)
>  	/* Make a copy so we can deface it with strtok */
>  	if ((config_iface = strdup(config_iface_init)) == NULL) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "exhausted virtual memory");
> -		corosync_exit_error (AIS_DONE_OBJDB);
> +		corosync_exit_error (COROSYNC_DONE_OBJDB);
>  	}
>  
>  	iface = strtok_r(config_iface, ":", &strtok_save_pt);
> @@ -1166,13 +1166,13 @@ int main (int argc, char **argv, char **envp)
>  		config = (struct config_iface_ver0 *)config_p;
>  		if (res == -1) {
>  			log_printf (LOGSYS_LEVEL_ERROR, "Corosync Executive couldn't open configuration component '%s'\n", iface);
> -			corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +			corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  		}
>  
>  		res = config->config_readconfig(&error_string);
>  		if (res == -1) {
>  			log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -			corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +			corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  		}
>  		log_printf (LOGSYS_LEVEL_NOTICE, "%s", error_string);
>  		config_modules[num_config_modules++] = config;
> @@ -1193,7 +1193,7 @@ int main (int argc, char **argv, char **envp)
>  		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
>  		fprintf(stderr, "%s", error_string);
>  		syslog (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  	}
>  
>  	/*
> @@ -1203,25 +1203,25 @@ int main (int argc, char **argv, char **envp)
>  	res = stat (corosync_lib_dir, &stat_out);
>  	if ((res == -1) || (res == 0 && !S_ISDIR(stat_out.st_mode))) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "Required directory not present %s.  Please create it.\n", corosync_lib_dir);
> -		corosync_exit_error (AIS_DONE_DIR_NOT_PRESENT);
> +		corosync_exit_error (COROSYNC_DONE_DIR_NOT_PRESENT);
>  	}
>  
>  	res = totem_config_read (&totem_config, &error_string);
>  	if (res == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  	}
>  
>  	res = totem_config_keyread (&totem_config, &error_string);
>  	if (res == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  	}
>  
>  	res = totem_config_validate (&totem_config, &error_string);
>  	if (res == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  	}
>  
>  	totem_config.totem_logging_configuration = totem_logging_configuration;
> @@ -1238,7 +1238,7 @@ int main (int argc, char **argv, char **envp)
>  		&error_string);
>  	if (res == -1) {
>  		log_printf (LOGSYS_LEVEL_ERROR, "%s", error_string);
> -		corosync_exit_error (AIS_DONE_MAINCONFIGREAD);
> +		corosync_exit_error (COROSYNC_DONE_MAINCONFIGREAD);
>  	}
>  
>  	/*
> @@ -1249,7 +1249,7 @@ int main (int argc, char **argv, char **envp)
>  	}
>  	qb_log_thread_start();
>  
> -	if ((flock_err = corosync_flock (corosync_lock_file, getpid ())) != AIS_DONE_EXIT) {
> +	if ((flock_err = corosync_flock (corosync_lock_file, getpid ())) != COROSYNC_DONE_EXIT) {
>  		corosync_exit_error (flock_err);
>  	}
>  
> @@ -1281,7 +1281,7 @@ int main (int argc, char **argv, char **envp)
>  		1);
>  
>  	/*
> -	 * Drop root privleges to user 'ais'
> +	 * Drop root privleges to user 'corosync'
>  	 * TODO: Don't really need full root capabilities;
>  	 *       needed capabilities are:
>  	 * CAP_NET_RAW (bindtodevice)
> @@ -1318,7 +1318,7 @@ int main (int argc, char **argv, char **envp)
>  	 */
>  	unlink (corosync_lock_file);
>  
> -	corosync_exit_error (AIS_DONE_EXIT);
> +	corosync_exit_error (COROSYNC_DONE_EXIT);
>  
>  	return EXIT_SUCCESS;
>  }
> diff --git a/exec/mainconfig.h b/exec/mainconfig.h
> index 2d5c552..b357799 100644
> --- a/exec/mainconfig.h
> +++ b/exec/mainconfig.h
> @@ -40,7 +40,7 @@
>  #include <corosync/coroapi.h>
>  
>  /**
> - * All service handlers in the AIS
> + * All service handlers
>   */
>  struct dynamic_service {
>  	char *name;
> diff --git a/exec/service.c b/exec/service.c
> index 1425bac..d70ffd4 100644
> --- a/exec/service.c
> +++ b/exec/service.c
> @@ -112,12 +112,12 @@ struct seus_handler_data {
>  	struct corosync_api_v1 *api;
>  };
>  
> -struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
> +struct corosync_service_engine *corosync_service[SERVICE_HANDLER_MAXIMUM_COUNT];
>  
>  const char *service_stats_rx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
>  const char *service_stats_tx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
>  
> -int ais_service_exiting[SERVICE_HANDLER_MAXIMUM_COUNT];
> +int corosync_service_exiting[SERVICE_HANDLER_MAXIMUM_COUNT];
>  
>  static void (*service_unlink_all_complete) (void) = NULL;
>  
> @@ -180,7 +180,7 @@ unsigned int corosync_service_link_and_init (
>  	 */
>  	service = iface_ver0->corosync_get_service_engine_ver0();
>  
> -	ais_service[service->id] = service;
> +	corosync_service[service->id] = service;
>  
>  	/*
>  	 * Register the log sites with libqb
> @@ -238,8 +238,8 @@ static int service_priority_max(void)
>  {
>  	int lpc = 0, max = 0;
>  	for(; lpc < SERVICE_HANDLER_MAXIMUM_COUNT; lpc++) {
> -		if(ais_service[lpc] != NULL && ais_service[lpc]->priority > max) {
> -			max = ais_service[lpc]->priority;
> +		if(corosync_service[lpc] != NULL && corosync_service[lpc]->priority > max) {
> +			max = corosync_service[lpc]->priority;
>  		}
>  	}
>  	return max;
> @@ -266,8 +266,8 @@ corosync_service_unlink_priority (
>  			*current_service_engine < SERVICE_HANDLER_MAXIMUM_COUNT;
>  			*current_service_engine = *current_service_engine + 1) {
>  
> -			if(ais_service[*current_service_engine] == NULL ||
> -				ais_service[*current_service_engine]->priority != *current_priority) {
> +			if(corosync_service[*current_service_engine] == NULL ||
> +				corosync_service[*current_service_engine]->priority != *current_priority) {
>  				continue;
>  			}
>  
> @@ -280,19 +280,19 @@ corosync_service_unlink_priority (
>  			 */
>  			snprintf(key_name, ICMAP_KEYNAME_MAXLEN,
>  					"internal_configuration.service.%u.handle",
> -					ais_service[*current_service_engine]->id);
> +					corosync_service[*current_service_engine]->id);
>  			if (icmap_get_uint64(key_name, &found_service_handle) == CS_OK) {
> -				service_id = ais_service[*current_service_engine]->id;
> +				service_id = corosync_service[*current_service_engine]->id;
>  
> -				if (ais_service[service_id]->exec_exit_fn) {
> -					res = ais_service[service_id]->exec_exit_fn ();
> +				if (corosync_service[service_id]->exec_exit_fn) {
> +					res = corosync_service[service_id]->exec_exit_fn ();
>  					if (res == -1) {
>  						return (-1);
>  					}
>  				}
>  
>  				*current_service_handle = found_service_handle;
> -				ais_service_exiting[*current_service_engine] = 1;
> +				corosync_service_exiting[*current_service_engine] = 1;
>  
>  				/*
>  				 * Call should call this function again
> @@ -359,10 +359,10 @@ static unsigned int service_unlink_and_exit (
>  	icmap_iter_finalize(iter);
>  
>  	if (service_found && service_id < SERVICE_HANDLER_MAXIMUM_COUNT
> -		&& ais_service[service_id] != NULL) {
> +		&& corosync_service[service_id] != NULL) {
>  
> -		if (ais_service[service_id]->exec_exit_fn) {
> -			res = ais_service[service_id]->exec_exit_fn ();
> +		if (corosync_service[service_id]->exec_exit_fn) {
> +			res = corosync_service[service_id]->exec_exit_fn ();
>  			if (res == -1) {
>  				return (-1);
>  			}
> @@ -370,9 +370,9 @@ static unsigned int service_unlink_and_exit (
>  
>  		log_printf(LOGSYS_LEVEL_NOTICE,
>  			"Service engine unloaded: %s\n",
> -			   ais_service[service_id]->name);
> +			   corosync_service[service_id]->name);
>  
> -		ais_service[service_id] = NULL;
> +		corosync_service[service_id] = NULL;
>  
>  		cs_ipcs_service_destroy (service_id);
>  
> @@ -473,9 +473,9 @@ static void service_unlink_schedwrk_handler (void *data) {
>  
>  	log_printf(LOGSYS_LEVEL_NOTICE,
>  		"Service engine unloaded: %s\n",
> -		ais_service[cb_data->service_engine]->name);
> +		corosync_service[cb_data->service_engine]->name);
>  
> -	ais_service[cb_data->service_engine] = NULL;
> +	corosync_service[cb_data->service_engine] = NULL;
>  
>  	lcr_ifact_release (cb_data->service_handle);
>  
> diff --git a/exec/service.h b/exec/service.h
> index 1ff132d..4fd0b50 100644
> --- a/exec/service.h
> +++ b/exec/service.h
> @@ -68,9 +68,9 @@ extern void corosync_service_unlink_all (
>  extern unsigned int corosync_service_defaults_link_and_init (
>  	struct corosync_api_v1 *objdb);
>  
> -extern struct corosync_service_engine *ais_service[];
> +extern struct corosync_service_engine *corosync_service[];
>  
> -extern int ais_service_exiting[];
> +extern int corosync_service_exiting[];
>  
>  extern const char *service_stats_rx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
>  extern const char *service_stats_tx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
> diff --git a/exec/totemudp.c b/exec/totemudp.c
> index 200b9b8..c44429e 100644
> --- a/exec/totemudp.c
> +++ b/exec/totemudp.c
> @@ -828,8 +828,7 @@ static int authenticate_and_decrypt (
>  	}
>  
>  	/*
> -	 * If it failed, then try decrypting the whole packet as it might be
> -	 * from aisexec
> +	 * If it failed, then try decrypting the whole packet
>  	 */
>  	if (res == -1) {
>  		iov[iov_len-1].iov_len += 1;
> diff --git a/exec/totemudpu.c b/exec/totemudpu.c
> index 6c6eae1..32c595b 100644
> --- a/exec/totemudpu.c
> +++ b/exec/totemudpu.c
> @@ -810,8 +810,7 @@ static int authenticate_and_decrypt (
>  	}
>  
>  	/*
> -	 * If it failed, then try decrypting the whole packet as it might be
> -	 * from aisexec
> +	 * If it failed, then try decrypting the whole packet
>  	 */
>  	if (res == -1) {
>  		iov[iov_len-1].iov_len += 1;
> diff --git a/exec/util.c b/exec/util.c
> index 6fde9f0..540036e 100644
> --- a/exec/util.c
> +++ b/exec/util.c
> @@ -135,12 +135,12 @@ void _corosync_out_of_memory_error (void)
>  }
>  
>  void _corosync_exit_error (
> -	enum e_ais_done err, const char *file, unsigned int line)  __attribute__((noreturn));
> +	enum e_corosync_done err, const char *file, unsigned int line)  __attribute__((noreturn));
>  
>  void _corosync_exit_error (
> -	enum e_ais_done err, const char *file, unsigned int line)
> +	enum e_corosync_done err, const char *file, unsigned int line)
>  {
> -	if (err == AIS_DONE_EXIT) {
> +	if (err == COROSYNC_DONE_EXIT) {
>  		log_printf (LOGSYS_LEVEL_NOTICE,
>  			"Corosync Cluster Engine exiting normally");
>  	} else {
> diff --git a/exec/util.h b/exec/util.h
> index 4228ae8..9462ac2 100644
> --- a/exec/util.h
> +++ b/exec/util.h
> @@ -43,27 +43,27 @@
>   */
>  extern cs_time_t clust_time_now(void);
>  
> -enum e_ais_done {
> -	AIS_DONE_EXIT = 0,
> -	AIS_DONE_UID_DETERMINE = 1,
> -	AIS_DONE_GID_DETERMINE = 2,
> -	AIS_DONE_MEMPOOL_INIT = 3,
> -	AIS_DONE_FORK = 4,
> -	AIS_DONE_LIBAIS_SOCKET = 5,
> -	AIS_DONE_LIBAIS_BIND = 6,
> -	AIS_DONE_READKEY = 7,
> -	AIS_DONE_MAINCONFIGREAD = 8,
> -	AIS_DONE_LOGSETUP = 9,
> -	AIS_DONE_AMFCONFIGREAD = 10,
> -	AIS_DONE_DYNAMICLOAD = 11,
> -	AIS_DONE_OBJDB = 12,
> -	AIS_DONE_INIT_SERVICES = 13,
> -	AIS_DONE_OUT_OF_MEMORY = 14,
> -	AIS_DONE_FATAL_ERR = 15,
> -	AIS_DONE_DIR_NOT_PRESENT = 16,
> -	AIS_DONE_AQUIRE_LOCK = 17,
> -	AIS_DONE_ALREADY_RUNNING = 18,
> -	AIS_DONE_STD_TO_NULL_REDIR = 19,
> +enum e_corosync_done {
> +	COROSYNC_DONE_EXIT = 0,
> +	COROSYNC_DONE_UID_DETERMINE = 1,
> +	COROSYNC_DONE_GID_DETERMINE = 2,
> +	COROSYNC_DONE_MEMPOOL_INIT = 3,
> +	COROSYNC_DONE_FORK = 4,
> +	COROSYNC_DONE_LIBCOROSYNC_SOCKET = 5,
> +	COROSYNC_DONE_LIBCOROSYNC_BIND = 6,
> +	COROSYNC_DONE_READKEY = 7,
> +	COROSYNC_DONE_MAINCONFIGREAD = 8,
> +	COROSYNC_DONE_LOGSETUP = 9,
> +	COROSYNC_DONE_AMFCONFIGREAD = 10,
> +	COROSYNC_DONE_DYNAMICLOAD = 11,
> +	COROSYNC_DONE_OBJDB = 12,
> +	COROSYNC_DONE_INIT_SERVICES = 13,
> +	COROSYNC_DONE_OUT_OF_MEMORY = 14,
> +	COROSYNC_DONE_FATAL_ERR = 15,
> +	COROSYNC_DONE_DIR_NOT_PRESENT = 16,
> +	COROSYNC_DONE_AQUIRE_LOCK = 17,
> +	COROSYNC_DONE_ALREADY_RUNNING = 18,
> +	COROSYNC_DONE_STD_TO_NULL_REDIR = 19,
>  };
>  
>  static inline cs_error_t hdb_error_to_cs (int res)		\
> @@ -92,7 +92,7 @@ static inline cs_error_t hdb_error_to_cs (int res)		\
>   */
>  extern int name_match(cs_name_t *name1, cs_name_t *name2);
>  #define corosync_exit_error(err) _corosync_exit_error ((err), __FILE__, __LINE__)
> -extern void _corosync_exit_error (enum e_ais_done err, const char *file,
> +extern void _corosync_exit_error (enum e_corosync_done err, const char *file,
>  				  unsigned int line) __attribute__((noreturn));
>  void _corosync_out_of_memory_error (void) __attribute__((noreturn));
>  extern char *getcs_name_t (cs_name_t *name);
> diff --git a/lib/util.h b/lib/util.h
> index fc5d502..a5b0053 100644
> --- a/lib/util.h
> +++ b/lib/util.h
> @@ -33,8 +33,8 @@
>   * THE POSSIBILITY OF SUCH DAMAGE.
>   */
>  
> -#ifndef AIS_UTIL_H_DEFINED
> -#define AIS_UTIL_H_DEFINED
> +#ifndef COROSYNC_UTIL_H_DEFINED
> +#define COROSYNC_UTIL_H_DEFINED
>  
>  #include <corosync/corotypes.h>
>  
> @@ -149,4 +149,4 @@ static inline const char * cs_strerror(cs_error_t err)
>  }
>  
>  
> -#endif /* AIS_UTIL_H_DEFINED */
> +#endif /* COROSYNC_UTIL_H_DEFINED */

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux