| 501 | } |
| 502 | |
| 503 | static int |
| 504 | vhost_user_reconnect_init(void) |
| 505 | { |
| 506 | int ret; |
| 507 | |
| 508 | ret = pthread_mutex_init(&reconn_list.mutex, NULL); |
| 509 | if (ret < 0) { |
| 510 | VHOST_LOG_CONFIG("thread", ERR, "%s: failed to initialize mutex\n", __func__); |
| 511 | return ret; |
| 512 | } |
| 513 | TAILQ_INIT(&reconn_list.head); |
| 514 | |
| 515 | ret = rte_thread_create_internal_control(&reconn_tid, "vhost-reco", |
| 516 | vhost_user_client_reconnect, NULL); |
| 517 | if (ret != 0) { |
| 518 | VHOST_LOG_CONFIG("thread", ERR, "failed to create reconnect thread\n"); |
| 519 | if (pthread_mutex_destroy(&reconn_list.mutex)) |
| 520 | VHOST_LOG_CONFIG("thread", ERR, |
| 521 | "%s: failed to destroy reconnect mutex\n", |
| 522 | __func__); |
| 523 | } |
| 524 | |
| 525 | return ret; |
| 526 | } |
| 527 | |
| 528 | static int |
| 529 | vhost_user_start_client(struct vhost_user_socket *vsocket) |
no test coverage detected