From: Ouyang Changchun Date: Mon, 6 Jul 2015 02:26:51 +0000 (+0800) Subject: vhost: add log on socket bind failure X-Git-Tag: spdx-start~8707 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1cbf787ef8701a59a03825f64f19425cd45ba33e;p=dpdk.git vhost: add log on socket bind failure It adds more readable log info if a socket fails to bind to local socket file name. Signed-off-by: Changchun Ouyang Acked-by: Huawei Xie --- diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c index 87a4711708..f406a94cb2 100644 --- a/lib/librte_vhost/vhost_user/vhost-net-user.c +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c @@ -122,8 +122,11 @@ uds_socket(const char *path) un.sun_family = AF_UNIX; snprintf(un.sun_path, sizeof(un.sun_path), "%s", path); ret = bind(sockfd, (struct sockaddr *)&un, sizeof(un)); - if (ret == -1) + if (ret == -1) { + RTE_LOG(ERR, VHOST_CONFIG, "fail to bind fd:%d, remove file:%s and try again.\n", + sockfd, path); goto err; + } RTE_LOG(INFO, VHOST_CONFIG, "bind to %s\n", path); ret = listen(sockfd, MAX_VIRTIO_BACKLOG);