MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / do_init

Function do_init

tools/crmadmin.c:405–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403};
404
405gboolean
406do_init(void)
407{
408 mainloop_io_t *source = mainloop_add_ipc_client(CRM_SYSTEM_CRMD, G_PRIORITY_DEFAULT, 0, NULL, &crm_callbacks);
409
410 admin_uuid = calloc(1, 11);
411 if (admin_uuid != NULL) {
412 snprintf(admin_uuid, 10, "%d", getpid());
413 admin_uuid[10] = '\0';
414 }
415
416 crmd_channel = mainloop_get_ipc_client(source);
417
418 if (DO_RESOURCE || DO_RESOURCE_LIST || DO_NODE_LIST) {
419 return TRUE;
420
421 } else if (crmd_channel != NULL) {
422 xmlNode *xml = create_hello_message(admin_uuid, crm_system_name, "0", "1");
423 crm_ipc_send(crmd_channel, xml, 0, 0, NULL);
424 return TRUE;
425 }
426 return FALSE;
427}
428
429static xmlNode *
430validate_crm_message(xmlNode * msg, const char *sys, const char *uuid, const char *msg_type)

Callers 1

mainFunction · 0.70

Calls 4

mainloop_add_ipc_clientFunction · 0.85
mainloop_get_ipc_clientFunction · 0.85
create_hello_messageFunction · 0.85
crm_ipc_sendFunction · 0.85

Tested by

no test coverage detected