| 1047 | } |
| 1048 | |
| 1049 | static bool |
| 1050 | vhost_user_remove_reconnect(struct vhost_user_socket *vsocket) |
| 1051 | { |
| 1052 | int found = false; |
| 1053 | struct vhost_user_reconnect *reconn, *next; |
| 1054 | |
| 1055 | pthread_mutex_lock(&reconn_list.mutex); |
| 1056 | |
| 1057 | for (reconn = TAILQ_FIRST(&reconn_list.head); |
| 1058 | reconn != NULL; reconn = next) { |
| 1059 | next = TAILQ_NEXT(reconn, next); |
| 1060 | |
| 1061 | if (reconn->vsocket == vsocket) { |
| 1062 | TAILQ_REMOVE(&reconn_list.head, reconn, next); |
| 1063 | close(reconn->fd); |
| 1064 | free(reconn); |
| 1065 | found = true; |
| 1066 | break; |
| 1067 | } |
| 1068 | } |
| 1069 | pthread_mutex_unlock(&reconn_list.mutex); |
| 1070 | return found; |
| 1071 | } |
| 1072 | |
| 1073 | /** |
| 1074 | * Unregister the specified vhost socket |
no test coverage detected