| 122 | } |
| 123 | |
| 124 | cs_error_t cmap_initialize_map (cmap_handle_t *handle, |
| 125 | cmap_map_t map) |
| 126 | { |
| 127 | cs_error_t error; |
| 128 | struct iovec iov[1]; |
| 129 | struct cmap_inst *cmap_inst; |
| 130 | struct req_lib_cmap_set_current_map req_lib_cmap_set_current_map; |
| 131 | struct qb_ipc_response_header res_lib_cmap_set_current_map; |
| 132 | |
| 133 | error = cmap_initialize(handle); |
| 134 | |
| 135 | if (error == CS_OK) { |
| 136 | error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, *handle, (void *)&cmap_inst)); |
| 137 | if (error != CS_OK) { |
| 138 | return (error); |
| 139 | } |
| 140 | |
| 141 | memset(&req_lib_cmap_set_current_map, 0, sizeof(req_lib_cmap_set_current_map)); |
| 142 | req_lib_cmap_set_current_map.header.size = sizeof(req_lib_cmap_set_current_map); |
| 143 | req_lib_cmap_set_current_map.header.id = MESSAGE_REQ_CMAP_SET_CURRENT_MAP; |
| 144 | req_lib_cmap_set_current_map.map = map; |
| 145 | |
| 146 | iov[0].iov_base = (char *)&req_lib_cmap_set_current_map; |
| 147 | iov[0].iov_len = sizeof(req_lib_cmap_set_current_map); |
| 148 | |
| 149 | error = qb_to_cs_error(qb_ipcc_sendv_recv( |
| 150 | cmap_inst->c, |
| 151 | iov, |
| 152 | 1, |
| 153 | &res_lib_cmap_set_current_map, |
| 154 | sizeof (res_lib_cmap_set_current_map), CS_IPC_TIMEOUT_MS)); |
| 155 | |
| 156 | if (error == CS_OK) { |
| 157 | error = res_lib_cmap_set_current_map.error; |
| 158 | } |
| 159 | |
| 160 | (void)hdb_handle_put (&cmap_handle_t_db, *handle); |
| 161 | |
| 162 | return (error); |
| 163 | } |
| 164 | return (error); |
| 165 | } |
| 166 | |
| 167 | static void cmap_inst_free (void *inst) |
| 168 | { |
no test coverage detected