ret = recvmsg(sockfd, &msgh, 0);
if (ret <= 0) {
- VHOST_LOG_CONFIG(ERR, "recvmsg failed\n");
+ if (ret)
+ VHOST_LOG_CONFIG(ERR, "recvmsg failed\n");
return ret;
}
vhost_destroy_device(conn->vid);
+ if (vsocket->reconnect) {
+ create_unix_socket(vsocket);
+ vhost_user_start_client(vsocket);
+ }
+
pthread_mutex_lock(&vsocket->conn_mutex);
TAILQ_REMOVE(&vsocket->conn_list, conn, next);
pthread_mutex_unlock(&vsocket->conn_mutex);
free(conn);
-
- if (vsocket->reconnect) {
- create_unix_socket(vsocket);
- vhost_user_start_client(vsocket);
- }
}
}
ret = -1;
goto out_mutex;
}
+ if (!vsocket->is_server) {
+ VHOST_LOG_CONFIG(ERR,
+ "error: zero copy is incompatible with vhost client mode\n");
+ ret = -1;
+ goto out_mutex;
+ }
vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER);
vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER);