From patchwork Fri Feb 2 08:39:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Zhiyong" X-Patchwork-Id: 34871 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 283BD37B7; Fri, 2 Feb 2018 09:39:20 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8986A2C72 for ; Fri, 2 Feb 2018 09:39:18 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 00:39:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="200631123" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.198]) by fmsmga005.fm.intel.com with ESMTP; 02 Feb 2018 00:39:16 -0800 From: Zhiyong Yang To: dev@dpdk.org Cc: yliu@fridaylinux.org, maxime.coquelin@redhat.com, Zhiyong Yang Date: Fri, 2 Feb 2018 16:39:14 +0800 Message-Id: <20180202083914.37584-1-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 Subject: [dpdk-dev] [PATCH] vhost: unlink existing file for server mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Vhost-user startup will fail based on server mode, if the specified socket file has already existed. The patch introduces function unlink() to remove the possible existing file. Cc: yliu@fridaylinux.org Cc: maxime.coquelin@redhat.com Signed-off-by: Zhiyong Yang --- lib/librte_vhost/socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 6e3857e7a..324a24f4e 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -315,6 +315,7 @@ vhost_user_start_server(struct vhost_user_socket *vsocket) int fd = vsocket->socket_fd; const char *path = vsocket->path; + unlink(path); ret = bind(fd, (struct sockaddr *)&vsocket->un, sizeof(vsocket->un)); if (ret < 0) { RTE_LOG(ERR, VHOST_CONFIG,