| 135 | } |
| 136 | |
| 137 | void |
| 138 | join_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void *user_data) |
| 139 | { |
| 140 | xmlNode *local_cib = NULL; |
| 141 | char *join_id = user_data; |
| 142 | xmlNode *generation = create_xml_node(NULL, XML_CIB_TAG_GENERATION_TUPPLE); |
| 143 | |
| 144 | CRM_LOG_ASSERT(join_id != NULL); |
| 145 | |
| 146 | query_call_id = 0; |
| 147 | |
| 148 | if (rc == pcmk_ok) { |
| 149 | local_cib = output; |
| 150 | CRM_LOG_ASSERT(safe_str_eq(crm_element_name(local_cib), XML_TAG_CIB)); |
| 151 | } |
| 152 | |
| 153 | if (local_cib != NULL) { |
| 154 | xmlNode *reply = NULL; |
| 155 | |
| 156 | crm_debug("Respond to join offer join-%s", join_id); |
| 157 | crm_debug("Acknowledging %s as our DC", fsa_our_dc); |
| 158 | copy_in_properties(generation, local_cib); |
| 159 | |
| 160 | reply = create_request(CRM_OP_JOIN_REQUEST, generation, fsa_our_dc, |
| 161 | CRM_SYSTEM_DC, CRM_SYSTEM_CRMD, NULL); |
| 162 | |
| 163 | crm_xml_add(reply, F_CRM_JOIN_ID, join_id); |
| 164 | if(fsa_our_dc) { |
| 165 | send_cluster_message(crm_get_peer(0, fsa_our_dc), crm_msg_crmd, reply, TRUE); |
| 166 | } else { |
| 167 | crm_warn("No DC for join-%s", join_id); |
| 168 | send_cluster_message(NULL, crm_msg_crmd, reply, TRUE); |
| 169 | } |
| 170 | free_xml(reply); |
| 171 | |
| 172 | } else { |
| 173 | crm_err("Could not retrieve Generation to attach to our" |
| 174 | " join acknowledgement: %s", pcmk_strerror(rc)); |
| 175 | register_fsa_error_adv(C_FSA_INTERNAL, I_ERROR, NULL, NULL, __FUNCTION__); |
| 176 | } |
| 177 | |
| 178 | free(join_id); |
| 179 | free_xml(generation); |
| 180 | } |
| 181 | |
| 182 | /* A_CL_JOIN_RESULT */ |
| 183 | /* aka. this is notification that we have (or have not) been accepted */ |
nothing calls this directly
no test coverage detected