crm_xml_add(xml_obj, XML_ATTR_ID, "standby");
do_work(ll_cluster_t * hb_cluster){	int ret = 1;	/* construct the request */	crm_data_t *msg_data = NULL;	gboolean all_is_good = TRUE;		msg_options = create_xml_node(NULL, XML_TAG_OPTIONS);	crm_xml_add(msg_options, XML_ATTR_VERBOSE, admin_verbose);	crm_xml_add(msg_options, XML_ATTR_TIMEOUT, "0");	if (DO_HEALTH == TRUE) {		crm_debug_2("Querying the system");				sys_to = CRM_SYSTEM_DC;				if (dest_node != NULL) {			sys_to = CRM_SYSTEM_CRMD;			crmd_operation = CRM_OP_PING;			if (BE_VERBOSE) {				expected_responses = -1;/* wait until timeout instead */			}						crm_xml_add(msg_options, XML_ATTR_TIMEOUT, "0");		} else {			crm_info("Cluster-wide health not available yet");			all_is_good = FALSE;		}					} else if(DO_ELECT_DC) {		/* tell the local node to initiate an election */		sys_to = CRM_SYSTEM_CRMD;		crmd_operation = CRM_OP_VOTE;				crm_xml_add(msg_options, XML_ATTR_TIMEOUT, "0");				dest_node = NULL;		ret = 0; /* no return message */			} else if(DO_WHOIS_DC) {		sys_to = CRM_SYSTEM_DC;		crmd_operation = CRM_OP_PING;					crm_xml_add(msg_options, XML_ATTR_TIMEOUT, "0");		dest_node = NULL;	} else if(DO_RESOURCE || DO_RESOURCE_LIST		  || DO_NODE_LIST || DO_OPTION || DO_STANDBY) {		cib_t *	the_cib = cib_new();		crm_data_t *output = NULL;		int call_options = cib_sync_call;				enum cib_errors rc = the_cib->cmds->signon(			the_cib, crm_system_name, cib_command);		if(rc != cib_ok) {			return -1;					} else if(DO_RESOURCE) {			output = get_cib_copy(the_cib);			do_find_resource(rsc_name, output);		} else if(DO_RESOURCE_LIST) {			crm_data_t *rscs = NULL;			output = get_cib_copy(the_cib);			rscs = get_object_root(XML_CIB_TAG_RESOURCES, output);			do_find_resource_list(0, rscs);					} else if(DO_NODE_LIST) {			output = get_cib_copy(the_cib);			do_find_node_list(output);					} else if(DO_OPTION) {			char *name = NULL;			char *value = NULL;			crm_data_t *xml_option = NULL;			crm_data_t *fragment = NULL;			if(decodeNVpair(crm_option, '=', &name, &value)==FALSE){				crm_err("%s needs to be of the form"					" <name>=<value>", crm_option);				return -1;			}						xml_option = create_xml_node(NULL, XML_CIB_TAG_NVPAIR);			crm_xml_add(xml_option, XML_NVPAIR_ATTR_NAME, name);			crm_xml_add(xml_option, XML_NVPAIR_ATTR_VALUE, value);						fragment = create_cib_fragment(xml_option, NULL);			free_xml(xml_option);			crm_free(name);			crm_free(value);						rc = the_cib->cmds->modify(				the_cib, XML_CIB_TAG_CRMCONFIG, fragment,				NULL, call_options|cib_discard_reply);						free_xml(fragment);		} else if(DO_STANDBY) {			crm_data_t *a_node = NULL;			crm_data_t *xml_obj = NULL;			crm_data_t *fragment = NULL;			a_node = create_xml_node(NULL, XML_CIB_TAG_NODE);			crm_xml_add(a_node, XML_ATTR_ID, dest_node);			xml_obj = create_xml_node(a_node, XML_TAG_ATTR_SETS);			xml_obj = create_xml_node(xml_obj, XML_TAG_ATTRS);			xml_obj = create_xml_node(xml_obj, XML_CIB_TAG_NVPAIR);			crm_xml_add(xml_obj, XML_NVPAIR_ATTR_NAME, "standby");			crm_xml_add(xml_obj, XML_NVPAIR_ATTR_VALUE, standby_on_off);						fragment = create_cib_fragment(a_node, NULL);			free_xml(a_node);						rc = the_cib->cmds->modify(				the_cib, XML_CIB_TAG_NODES, fragment,				NULL, call_options|cib_discard_reply);						free_xml(fragment);		}		free_xml(output);		the_cib->cmds->signoff(the_cib);		exit(rc);			} else if(DO_RESET) {		/* tell dest_node to initiate the shutdown proceedure		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		crm_xml_add(msg_options, XML_ATTR_TIMEOUT, "0");				ret = 0; /* no return message */			} else if(DO_DEBUG == debug_inc) {		/* tell dest_node to increase its debug level		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		crmd_operation = CRM_OP_DEBUG_UP;				ret = 0; /* no return message */			} else if(DO_DEBUG == debug_dec) {		/* tell dest_node to increase its debug level		 *		 * if dest_node is NULL, the request will be sent to the		 *   local node		 */		sys_to = CRM_SYSTEM_CRMD;		crmd_operation = CRM_OP_DEBUG_DOWN;				ret = 0; /* no return message */			} else {		crm_err("Unknown options");		all_is_good = FALSE;	}		if(all_is_good == FALSE) {		crm_err("Creation of request failed.  No message to send");		return -1;	}/* send it */	if (crmd_channel == NULL) {		crm_err("The IPC connection is not valid, cannot send anything");		return -1;	}	if(sys_to == NULL) {		if (dest_node != NULL)			sys_to = CRM_SYSTEM_CRMD;		else			sys_to = CRM_SYSTEM_DC;					}		{		HA_Message *cmd = create_request(			crmd_operation, msg_data, dest_node, sys_to,			crm_system_name, admin_uuid);		if(this_msg_reference != NULL) {			ha_msg_mod(cmd, XML_ATTR_REFERENCE, this_msg_reference);		}		send_ipc_message(crmd_channel, cmd);	}		return ret;}