示例#1
0
static void ykd_init (
	struct corosync_api_v1 *corosync_api,
	quorum_set_quorate_fn_t set_primary)
{
	ykd_primary_callback_fn = set_primary;
	api = corosync_api;

	api->tpg_init (
		&ykd_group_handle,
		ykd_deliver_fn,
		ykd_confchg_fn);

	api->tpg_join (
		ykd_group_handle,
		&ykd_group,
		1);

	ykd_state_init ();
}
static int ykd_init (
	void (*primary_callback_fn) (
		unsigned int *view_list,
		int view_list_entries,
		int primary_designated,
		struct memb_ring_id *ring_id))
{
	ykd_primary_callback_fn = primary_callback_fn;

	totempg_groups_initialize (
		&ykd_group_handle,
		ykd_deliver_fn,
		ykd_confchg_fn);

	totempg_groups_join (
		ykd_group_handle,
		&ykd_group,
		1);

	ykd_state_init ();

	return (0);
}