Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
pacemaker
pacemaker-crmd-always-assert-when-operation-can...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-crmd-always-assert-when-operation-cant-be-created.patch of Package pacemaker
commit 12151028bdc8c8a25d5dc3f7c0e13bc6c50de4a8 Author: Ken Gaillot <kgaillot@redhat.com> Date: Thu Mar 1 11:09:35 2018 -0600 Low: crmd: always assert when operation can't be created Previously, all callers but one asserted if construct_op() returned NULL. Now, the assert is done in construct_op() to reduce code duplication and chance for mistakes. diff --git a/crmd/lrm.c b/crmd/lrm.c index ee1653412..1cc16dc7d 100644 --- a/crmd/lrm.c +++ b/crmd/lrm.c @@ -289,7 +289,6 @@ send_task_ok_ack(lrm_state_t *lrm_state, ha_msg_input_t *input, { lrmd_event_data_t *op = construct_op(lrm_state, input->xml, rsc_id, task); - CRM_ASSERT(op != NULL); op->rc = PCMK_OCF_OK; op->op_status = PCMK_LRM_OP_DONE; send_direct_ack(ack_host, ack_sys, rsc, op, rsc_id); @@ -867,7 +866,6 @@ notify_deleted(lrm_state_t * lrm_state, ha_msg_input_t * input, const char *rsc_ ((rc == pcmk_ok)? "" : " not")); op = construct_op(lrm_state, input->xml, rsc_id, CRMD_ACTION_DELETE); - CRM_ASSERT(op != NULL); if (rc == pcmk_ok) { op->op_status = PCMK_LRM_OP_DONE; @@ -1432,7 +1430,6 @@ synthesize_lrmd_failure(lrm_state_t *lrm_state, xmlNode *action, int rc) } op = construct_op(lrm_state, action, ID(xml_rsc), operation); - CRM_ASSERT(op != NULL); op->call_id = get_fake_call_id(lrm_state, op->rsc_id); if(safe_str_eq(operation, RSC_NOTIFY)) { @@ -1511,7 +1508,6 @@ fail_lrm_resource(xmlNode *xml, lrm_state_t *lrm_state, const char *user_name, * it came from the lrmd. */ op = construct_op(lrm_state, xml, ID(xml_rsc), "asyncmon"); - CRM_ASSERT(op != NULL); free((char*) op->user_data); op->user_data = NULL; @@ -1883,9 +1879,11 @@ construct_op(lrm_state_t * lrm_state, xmlNode * rsc_op, const char *rsc_id, cons const char *transition = NULL; - CRM_ASSERT(rsc_id != NULL); + CRM_ASSERT(rsc_id && operation); op = calloc(1, sizeof(lrmd_event_data_t)); + CRM_ASSERT(op != NULL); + op->type = lrmd_event_exec_complete; op->op_type = strdup(operation); op->op_status = PCMK_LRM_OP_PENDING;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor