MCPcopy Create free account
hub / github.com/corosync/corosync / wd_resource_created_cb

Function wd_resource_created_cb

exec/wd.c:515–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515static void wd_resource_created_cb(
516 int32_t event,
517 const char *key_name,
518 struct icmap_notify_value new_val,
519 struct icmap_notify_value old_val,
520 void *user_data)
521{
522 char res_name[ICMAP_KEYNAME_MAXLEN];
523 char res_type[ICMAP_KEYNAME_MAXLEN];
524 char tmp_key[ICMAP_KEYNAME_MAXLEN];
525 int res;
526
527 if (event != ICMAP_TRACK_ADD) {
528 return ;
529 }
530
531 res = sscanf(key_name, "resources.%[^.].%[^.].%[^.]", res_type, res_name, tmp_key);
532 if (res != 3) {
533 return ;
534 }
535
536 if (strcmp(tmp_key, "state") != 0) {
537 return ;
538 }
539
540 snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "resources.%s.%s.", res_type, res_name);
541 wd_resource_create (tmp_key, res_name);
542}
543
544static void wd_scan_resources (void)
545{

Callers

nothing calls this directly

Calls 1

wd_resource_createFunction · 0.85

Tested by

no test coverage detected