コード例 #1
0
/*	 A_DC_JOIN_OFFER_ONE	*/
void
do_dc_join_offer_one(long long action,
		     enum crmd_fsa_cause cause,
		     enum crmd_fsa_state cur_state,
		     enum crmd_fsa_input current_input,
		     fsa_data_t *msg_data)
{
	crm_node_t *member;
	ha_msg_input_t *welcome = NULL;

	const char *op = NULL;
	const char *join_to = NULL;

	if(msg_data->data) {
	    welcome = fsa_typed_data(fsa_dt_ha_msg);

	} else {
	    crm_info("A new node joined - wait until it contacts us");
	    return;
	}
	
	if(welcome == NULL) {
		crm_err("Attempt to send welcome message "
			"without a message to reply to!");
		return;
	}
	
	join_to = crm_element_value(welcome->msg, F_CRM_HOST_FROM);
	if(join_to == NULL) {
	    crm_err("Attempt to send welcome message "
		    "without a host to reply to!");
	    return;
	}

	member = crm_get_peer(0, join_to);
	if(member == NULL || crm_is_member_active(member) == FALSE) {
	    crm_err("Attempt to send welcome message "
		    "to a node not part of our partition!");
	    return;
	}
	
	op = crm_element_value(welcome->msg, F_CRM_TASK);
	if(join_to != NULL
	   && (cur_state == S_INTEGRATION || cur_state == S_FINALIZE_JOIN)) {
		/* note: it _is_ possible that a node will have been
		 *  sick or starting up when the original offer was made.
		 *  however, it will either re-announce itself in due course
		 *  _or_ we can re-store the original offer on the client.
		 */
		crm_debug("(Re-)offering membership to %s...", join_to);
	}

	crm_info("join-%d: Processing %s request from %s in state %s",
		 current_join_id, op, join_to, fsa_state2string(cur_state));

	join_make_offer(NULL, member, NULL);
	
	/* always offer to the DC (ourselves)
	 * this ensures the correct value for max_generation_from
	 */
	member = crm_get_peer(0, fsa_our_uname);
	join_make_offer(NULL, member, NULL);	
	
	/* this was a genuine join request, cancel any existing
	 * transition and invoke the PE
	 */
	start_transition(fsa_state);
	
	/* dont waste time by invoking the pe yet; */
	crm_debug("Waiting on %d outstanding join acks for join-%d",
		  g_hash_table_size(welcomed_nodes), current_join_id);
}
コード例 #2
0
ファイル: bootm.c プロジェクト: tiagolb/liboot-tz
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{
	printf("do_bootm_linux: 0x%08x\n", &do_bootm_linux);
	bd_t	*bd = gd->bd;
	char	*s;
	int	machid = bd->bi_arch_number;
	void	(*theKernel)(int zero, int arch, uint params);

#ifdef CONFIG_CMDLINE_TAG
	char *commandline = getenv ("bootargs");
#endif

	if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
		return 1;

	theKernel = (void (*)(int, int, uint))images->ep;

	s = getenv ("machid");
	if (s) {
		machid = simple_strtoul (s, NULL, 16);
		printf ("Using machid 0x%x from environment\n", machid);
	}

	show_boot_progress (15);

	debug ("## Transferring control to Linux (at address %08lx) ...\n",
	       (ulong) theKernel);

#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
    defined (CONFIG_CMDLINE_TAG) || \
    defined (CONFIG_INITRD_TAG) || \
    defined (CONFIG_SERIAL_TAG) || \
    defined (CONFIG_REVISION_TAG) || \
    defined (CONFIG_LCD) || \
    defined (CONFIG_VFD)
	setup_start_tag (bd);
#ifdef CONFIG_SERIAL_TAG
	setup_serial_tag (&params);
#endif
#ifdef CONFIG_REVISION_TAG
	setup_revision_tag (&params);
#endif
#ifdef CONFIG_SETUP_MEMORY_TAGS
	printf("setup_memory_tags\n");
	setup_memory_tags (bd);
#endif
#ifdef CONFIG_CMDLINE_TAG
	setup_commandline_tag (bd, commandline);
#endif
#ifdef CONFIG_INITRD_TAG
	if (images->rd_start && images->rd_end)
		setup_initrd_tag (bd, images->rd_start, images->rd_end);
#endif
#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
	setup_videolfb_tag ((gd_t *) gd);
#endif
	setup_end_tag (bd);
#endif

	/* we assume that the kernel is in place */
	printf ("\nStarting kernel ...\n\n");

#ifdef CONFIG_USB_DEVICE
	{
		extern void udc_disconnect (void);
		udc_disconnect ();
	}
#endif

	cleanup_before_linux ();

	//Dongli-start
	printf("#### Kernel is booted.\n");
	printf("###### We are jumping to the kernel now!!!!\n");
	start_transition(images, machid, bd->bi_boot_params);
	//Dongli-end
	//theKernel (0, machid, bd->bi_boot_params);
	/* does not return */

	return 1;
}