} else if(strcmp("quit", op) == 0) {
} else if(strcmp(CRM_OP_QUIT, op) == 0) {
cib_process_request(const char *op,		    const xmlNodePtr options,		    const xmlNodePtr fragment,		    enum cib_result *result){	const char *verbose        = NULL;	const char *section        = NULL;	const char *output_section = NULL;	xmlNodePtr failed          = NULL;	xmlNodePtr cib_answer      = NULL;	gboolean update_the_cib = FALSE;	int cib_update_op = CIB_OP_NONE;	xmlNodePtr tmpCib;	char *new_value = NULL;	char *old_value = NULL;	int int_value = -1;	FNIN();		*result = CIBRES_OK;	verbose = xmlGetProp(options, XML_ATTR_VERBOSE);	section = xmlGetProp(options, XML_ATTR_FILTER_TYPE);	failed  = create_xml_node(NULL, XML_TAG_FAILED);#ifdef MSG_LOG	if(msg_cib_strm == NULL) {		msg_cib_strm = fopen("/tmp/cib.log", "w");	}	fprintf(msg_cib_strm, "[Input %s]\t%s\n", op, dump_xml_node(fragment, FALSE));	fflush(msg_cib_strm);#endif	cl_log(LOG_DEBUG, "[cib] Processing \"%s\" event", op);		if(op == NULL) {		*result = CIBRES_FAILED;		cl_log(LOG_ERR, "No operation specified\n");			} else if(strcmp("noop", op) == 0) {		;			} else if(strcmp("quit", op) == 0) {		cl_log(LOG_WARNING,		       "The CRMd has asked us to exit... complying");		exit(0);			} else if (strcmp(CRM_OPERATION_PING, op) == 0) {		cib_answer =			createPingAnswerFragment(CRM_SYSTEM_CIB, "ok");			} else if (strcmp(CRM_OPERATION_BUMP, op) == 0) {		tmpCib = get_cib_copy();		CRM_DEBUG("Handling a %s for section=%s of the cib",			   CRM_OPERATION_BUMP, section);				// modify the timestamp		set_node_tstamp(tmpCib);		old_value =			xmlGetProp(get_the_CIB(), XML_ATTR_GENERATION);				if(old_value != NULL) {			new_value = (char*)crm_malloc(128*(sizeof(char)));			int_value = atoi(old_value);			sprintf(new_value, "%d", ++int_value);		} else {			new_value = crm_strdup("0");		}		cl_log(LOG_DEBUG, "Generation %d(%s)->%s",		       int_value, old_value, new_value);				set_xml_property_copy(tmpCib, XML_ATTR_GENERATION, new_value);		crm_free(new_value);				if(activateCibXml(tmpCib, CIB_FILENAME) >= 0) {			verbose = "true"; 		} else {			*result = CIBRES_FAILED;		}					} else if (strcmp("query", op) == 0) {		CRM_DEBUG("Handling a query for section=%s of the cib",			   section);		/* force a pick-up of the relevant section before		 * returning		 */		verbose = "true"; 			} else if (strcmp(CRM_OPERATION_ERASE, op) == 0) {		xmlNodePtr new_cib = createEmptyCib();		// Preserve generation counters etc		copy_in_properties(new_cib, get_the_CIB());				if (activateCibXml(new_cib, CIB_FILENAME) < 0) {			*result = CIBRES_FAILED;		}	} else if (strcmp(CRM_OPERATION_CREATE, op) == 0) {		update_the_cib = TRUE;		cib_update_op = CIB_OP_ADD;			} else if (strcmp(CRM_OPERATION_UPDATE, op) == 0		   || strcmp(CRM_OPERATION_WELCOME, op) == 0		   || strcmp(CRM_OPERATION_SHUTDOWN_REQ, op) == 0) {		update_the_cib = TRUE;		cib_update_op = CIB_OP_MODIFY;			} else if (strcmp(CRM_OPERATION_DELETE, op) == 0) {		update_the_cib = TRUE;		cib_update_op = CIB_OP_DELETE;	} else if (strcmp(CRM_OPERATION_REPLACE, op) == 0) {		CRM_DEBUG("Replacing section=%s of the cib", section);		section = xmlGetProp(fragment, XML_ATTR_SECTION);		if (section == NULL		    || strlen(section) == 0		    || strcmp("all", section) == 0) {			tmpCib = copy_xml_node_recursive(				find_xml_node(fragment, XML_TAG_CIB));		} else {			tmpCib = copy_xml_node_recursive(get_the_CIB());			replace_section(section, tmpCib, fragment);		}		/*if(check_generation(cib_updates, tmpCib) == FALSE)			*result = "discarded old update";			else */		if (activateCibXml(tmpCib, CIB_FILENAME) < 0)			*result = CIBRES_FAILED;	} else {		*result = CIBRES_FAILED_NOTSUPPORTED;		cl_log(LOG_ERR, "Action [%s] is not supported by the CIB", op);	}    	if (update_the_cib) {		CRM_DEBUG("Backing up CIB");		tmpCib = copy_xml_node_recursive(get_the_CIB());		section = xmlGetProp(fragment, XML_ATTR_SECTION);		CRM_DEBUG("Updating section=%s of the cib (op=%s)",			   section, op);			// should we be doing this?			// do logging						// make changes to a temp copy then activate		if(section == NULL) {			cl_log(LOG_ERR, "No section specified in %s",			       XML_ATTR_FILTER_TYPE);			*result = CIBRES_FAILED_NOSECTION;		} else if(strcmp("all", section) == 0			  && cib_update_op == CIB_OP_DELETE) {			// delete			/* order is no longer important here */			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_STATUS);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_CONSTRAINTS);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_RESOURCES);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_NODES);		} else if(strcmp("all", section) == 0) {			/* order is no longer important here */			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_NODES);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_RESOURCES);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_CONSTRAINTS);			updateList(tmpCib, fragment, failed, cib_update_op,				   XML_CIB_TAG_STATUS);		} else {			*result = updateList(tmpCib, fragment, failed,					     cib_update_op, section);		}				CRM_DEBUG("Activating temporary CIB");		/* if(check_generation(cib_updates, tmpCib) == FALSE) *//* 			status = "discarded old update"; *//* 		else  */		if (activateCibXml(tmpCib, CIB_FILENAME) < 0) {			*result = CIBRES_FAILED_ACTIVATION;					} else if (failed->children != NULL) {			*result = CIBRES_FAILED;		}				CRM_DEBUG("CIB update status: %d", *result);	}		output_section = section;		if (failed->children != NULL || *result != CIBRES_OK) {		cib_answer = createCibFragmentAnswer(NULL /*"all"*/, failed);		} else if (verbose != NULL && strcmp("true", verbose) == 0) {		cib_answer = createCibFragmentAnswer(output_section, failed);	}	free_xml(failed);#ifdef MSG_LOG	fprintf(msg_cib_strm, "[Reply (%s)]\t%s\n",		op, dump_xml_node(cib_answer, FALSE));	fflush(msg_cib_strm);#endif	FNRET(cib_answer);}