summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOuyang Changchun <changchun.ouyang@intel.com>2015-07-06 10:26:51 +0800
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-07-17 14:53:26 +0200
commit1cbf787ef8701a59a03825f64f19425cd45ba33e (patch)
tree9340c518270687e836201862721b71ee932614d6
parent22561383ea1776cecb454a98242a3bcec82ca4e2 (diff)
downloaddpdk-1cbf787ef8701a59a03825f64f19425cd45ba33e.zip
dpdk-1cbf787ef8701a59a03825f64f19425cd45ba33e.tar.gz
dpdk-1cbf787ef8701a59a03825f64f19425cd45ba33e.tar.xz
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 <changchun.ouyang@intel.com> Acked-by: Huawei Xie <huawei.xie@intel.com>
-rw-r--r--lib/librte_vhost/vhost_user/vhost-net-user.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c
index 87a4711..f406a94 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);