* Register ops so that we can add/remove device to data core. */
| 1157 | * Register ops so that we can add/remove device to data core. |
| 1158 | */ |
| 1159 | int |
| 1160 | rte_vhost_driver_callback_register(const char *path, |
| 1161 | struct rte_vhost_device_ops const * const ops) |
| 1162 | { |
| 1163 | struct vhost_user_socket *vsocket; |
| 1164 | |
| 1165 | pthread_mutex_lock(&vhost_user.mutex); |
| 1166 | vsocket = find_vhost_user_socket(path); |
| 1167 | if (vsocket) |
| 1168 | vsocket->notify_ops = ops; |
| 1169 | pthread_mutex_unlock(&vhost_user.mutex); |
| 1170 | |
| 1171 | return vsocket ? 0 : -1; |
| 1172 | } |
| 1173 | |
| 1174 | struct rte_vhost_device_ops const * |
| 1175 | vhost_driver_callback_get(const char *path) |
no test coverage detected