From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1895A5A0C for ; Thu, 2 Jul 2015 05:33:24 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 01 Jul 2015 20:33:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,389,1432623600"; d="scan'208";a="738951781" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 01 Jul 2015 20:33:11 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t623X93w006638; Thu, 2 Jul 2015 11:33:09 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t623X6jY020423; Thu, 2 Jul 2015 11:33:08 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t623X6wV020419; Thu, 2 Jul 2015 11:33:06 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Thu, 2 Jul 2015 11:33:01 +0800 Message-Id: <1435807983-20383-2-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1435807983-20383-1-git-send-email-changchun.ouyang@intel.com> References: <1435807983-20383-1-git-send-email-changchun.ouyang@intel.com> Subject: [dpdk-dev] [PATCH 1/3] vhost: add log if fails to bind a socket X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2015 03:33:26 -0000 It adds more readable log info if a socket fails to bind to local device file name. Signed-off-by: Changchun Ouyang --- lib/librte_vhost/vhost_user/vhost-net-user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 1.8.4.2