| 411 | } |
| 412 | |
| 413 | static void mon_key_changed_cb ( |
| 414 | int32_t event, |
| 415 | const char *key_name, |
| 416 | struct icmap_notify_value new_value, |
| 417 | struct icmap_notify_value old_value, |
| 418 | void *user_data) |
| 419 | { |
| 420 | struct resource_instance* inst = (struct resource_instance*)user_data; |
| 421 | char *last_key_part; |
| 422 | |
| 423 | if (event == ICMAP_TRACK_DELETE && inst) { |
| 424 | log_printf (LOGSYS_LEVEL_WARNING, |
| 425 | "resource \"%s\" deleted from cmap!", |
| 426 | inst->name); |
| 427 | |
| 428 | cs_fsm_process (&inst->fsm, MON_E_CONFIG_CHANGED, inst, mon_fsm_cb); |
| 429 | } |
| 430 | |
| 431 | if (event == ICMAP_TRACK_MODIFY) { |
| 432 | last_key_part = strrchr(key_name, '.'); |
| 433 | if (last_key_part == NULL) |
| 434 | return ; |
| 435 | |
| 436 | last_key_part++; |
| 437 | if (strcmp(last_key_part, "max") == 0 || |
| 438 | strcmp(last_key_part, "poll_period") == 0) { |
| 439 | ENTER(); |
| 440 | cs_fsm_process (&inst->fsm, MON_E_CONFIG_CHANGED, inst, mon_fsm_cb); |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | static void mon_instance_init (struct resource_instance* inst) |
| 446 | { |
nothing calls this directly
no test coverage detected