Tell another cluster node to shutdown. reason is a string that will be written to the system log files.
(handle: &Handle, nodeid: NodeId, reason: &str)
| 206 | /// Tell another cluster node to shutdown. reason is a string that |
| 207 | /// will be written to the system log files. |
| 208 | pub fn kill_node(handle: &Handle, nodeid: NodeId, reason: &str) -> Result<()> { |
| 209 | let c_string = { |
| 210 | match CString::new(reason) { |
| 211 | Ok(cs) => cs, |
| 212 | Err(_) => return Err(CsError::CsErrInvalidParam), |
| 213 | } |
| 214 | }; |
| 215 | |
| 216 | let res = unsafe { |
| 217 | ffi::corosync_cfg_kill_node(handle.cfg_handle, u32::from(nodeid), c_string.as_ptr()) |
| 218 | }; |
| 219 | if res == ffi::CS_OK { |
| 220 | Ok(()) |
| 221 | } else { |
| 222 | Err(CsError::from_c(res)) |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | /// Ask this cluster node to shutdown. If [ShutdownFlags] is set to Request then |
| 227 | ///it may be refused by other applications |
nothing calls this directly
no test coverage detected