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 A5F381396 for ; Thu, 2 Jul 2015 11:33:26 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 02 Jul 2015 02:33:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,391,1432623600"; d="scan'208";a="721624736" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga001.jf.intel.com with ESMTP; 02 Jul 2015 02:33:25 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 2 Jul 2015 17:29:23 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.246]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.146]) with mapi id 14.03.0224.002; Thu, 2 Jul 2015 17:29:22 +0800 From: "Xie, Huawei" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [PATCH 1/3] vhost: add log if fails to bind a socket Thread-Index: AdC0qZOeK4V85aWvTKCyJNcPsJ+Uaw== Date: Thu, 2 Jul 2015 09:29:21 +0000 Message-ID: References: <1435807983-20383-1-git-send-email-changchun.ouyang@intel.com> <1435807983-20383-2-git-send-email-changchun.ouyang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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 09:33:27 -0000 On 7/2/2015 11:33 AM, Ouyang, Changchun wrote:=0A= > It adds more readable log info if a socket fails to bind to local device = file name.=0A= local socket file, not device file. :).=0A= >=0A= > Signed-off-by: Changchun Ouyang =0A= > ---=0A= > lib/librte_vhost/vhost_user/vhost-net-user.c | 5 ++++-=0A= > 1 file changed, 4 insertions(+), 1 deletion(-)=0A= >=0A= > diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vh= ost/vhost_user/vhost-net-user.c=0A= > index 87a4711..f406a94 100644=0A= > --- a/lib/librte_vhost/vhost_user/vhost-net-user.c=0A= > +++ b/lib/librte_vhost/vhost_user/vhost-net-user.c=0A= > @@ -122,8 +122,11 @@ uds_socket(const char *path)=0A= > un.sun_family =3D AF_UNIX;=0A= > snprintf(un.sun_path, sizeof(un.sun_path), "%s", path);=0A= > ret =3D bind(sockfd, (struct sockaddr *)&un, sizeof(un));=0A= > - if (ret =3D=3D -1)=0A= > + if (ret =3D=3D -1) {=0A= > + RTE_LOG(ERR, VHOST_CONFIG, "fail to bind fd:%d, remove file:%s and try= again.\n",=0A= > + sockfd, path);=0A= > goto err;=0A= > + }=0A= > RTE_LOG(INFO, VHOST_CONFIG, "bind to %s\n", path);=0A= > =0A= > ret =3D listen(sockfd, MAX_VIRTIO_BACKLOG);=0A= =0A=