Example #1
0
int drslot_chrp_mem(void)
{
	int rc = -1;

	if (usr_p_option) {
		/* This is a entitlement or weight change */
		return update_sysparm();
	}

	if (! mem_dlpar_capable() || ! ehea_compatable()) {
		say(ERROR, "DLPAR memory operations are not supported on"
		    "this kernel.");
		return -1;
	}

	/* The recursive nature of the routines that add/remove lmbs
	 * require that the quantity be non-zero.
	 */
	if (usr_drc_name)
		usr_drc_count = 1;

	if (kernel_dlpar_exists()) {
		rc = do_mem_kernel_dlpar();
	} else {
		if (usr_action == ADD)
			rc = mem_add();
		else if (usr_action == REMOVE)
			rc = mem_remove();
	}

	return rc;
}