From patchwork Mon Jul 6 02:26:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ouyang Changchun X-Patchwork-Id: 6089 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 406A9C3BC; Mon, 6 Jul 2015 04:27:07 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5749F6849 for ; Mon, 6 Jul 2015 04:27:04 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Jul 2015 19:27:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,412,1432623600"; d="scan'208";a="723402113" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 05 Jul 2015 19:27:03 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t662R0w9009553; Mon, 6 Jul 2015 10:27:00 +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 t662Qv3U030421; Mon, 6 Jul 2015 10:26:59 +0800 Received: (from couyang@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t662QvIs030417; Mon, 6 Jul 2015 10:26:57 +0800 From: Ouyang Changchun To: dev@dpdk.org Date: Mon, 6 Jul 2015 10:26:51 +0800 Message-Id: <1436149613-30239-2-git-send-email-changchun.ouyang@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1436149613-30239-1-git-send-email-changchun.ouyang@intel.com> References: <1435807983-20383-1-git-send-email-changchun.ouyang@intel.com> <1436149613-30239-1-git-send-email-changchun.ouyang@intel.com> Subject: [dpdk-dev] [PATCH v2 1/3] vhost: add log when failing 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" It adds more readable log info if a socket fails to bind to local socket 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);