| 517 | } |
| 518 | |
| 519 | cs_error_t |
| 520 | corosync_cfg_kill_node ( |
| 521 | corosync_cfg_handle_t cfg_handle, |
| 522 | unsigned int nodeid, |
| 523 | const char *reason) |
| 524 | { |
| 525 | struct cfg_inst *cfg_inst; |
| 526 | struct req_lib_cfg_killnode req_lib_cfg_killnode; |
| 527 | struct res_lib_cfg_killnode res_lib_cfg_killnode; |
| 528 | cs_error_t error; |
| 529 | struct iovec iov; |
| 530 | |
| 531 | if (strlen(reason) >= CS_MAX_NAME_LENGTH) |
| 532 | return CS_ERR_NAME_TOO_LONG; |
| 533 | |
| 534 | error = hdb_error_to_cs (hdb_handle_get (&cfg_hdb, cfg_handle, |
| 535 | (void *)&cfg_inst)); |
| 536 | if (error != CS_OK) { |
| 537 | return (error); |
| 538 | } |
| 539 | |
| 540 | req_lib_cfg_killnode.header.id = MESSAGE_REQ_CFG_KILLNODE; |
| 541 | req_lib_cfg_killnode.header.size = sizeof (struct req_lib_cfg_killnode); |
| 542 | req_lib_cfg_killnode.nodeid = nodeid; |
| 543 | strcpy((char *)req_lib_cfg_killnode.reason.value, reason); |
| 544 | req_lib_cfg_killnode.reason.length = strlen(reason)+1; |
| 545 | |
| 546 | iov.iov_base = (void *)&req_lib_cfg_killnode; |
| 547 | iov.iov_len = sizeof (struct req_lib_cfg_killnode); |
| 548 | |
| 549 | error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c, |
| 550 | &iov, |
| 551 | 1, |
| 552 | &res_lib_cfg_killnode, |
| 553 | sizeof (struct res_lib_cfg_killnode), CS_IPC_TIMEOUT_MS)); |
| 554 | |
| 555 | error = res_lib_cfg_killnode.header.error; |
| 556 | |
| 557 | (void)hdb_handle_put (&cfg_hdb, cfg_handle); |
| 558 | |
| 559 | return (error == CS_OK ? res_lib_cfg_killnode.header.error : error); |
| 560 | } |
| 561 | |
| 562 | cs_error_t |
| 563 | corosync_cfg_try_shutdown ( |
no test coverage detected