From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 817387EBB for ; Wed, 8 Oct 2014 20:49:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 08 Oct 2014 11:54:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,679,1406617200"; d="scan'208";a="615348456" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 08 Oct 2014 11:56:59 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s98Iuu8X022384; Thu, 9 Oct 2014 02:56:56 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s98IusNT004462; Thu, 9 Oct 2014 02:56:56 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s98IusLj004458; Thu, 9 Oct 2014 02:56:54 +0800 From: Huawei Xie To: dev@dpdk.org Date: Thu, 9 Oct 2014 02:54:47 +0800 Message-Id: <1412794499-4332-14-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> References: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH v6 13/25] lib/librte_vhost: remove index parameter 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: Wed, 08 Oct 2014 18:49:42 -0000 Signed-off-by: Huawei Xie --- lib/librte_vhost/vhost-net-cdev.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/librte_vhost/vhost-net-cdev.c b/lib/librte_vhost/vhost-net-cdev.c index 8cf806a..957f0c8 100644 --- a/lib/librte_vhost/vhost-net-cdev.c +++ b/lib/librte_vhost/vhost-net-cdev.c @@ -302,7 +302,7 @@ static const struct cuse_lowlevel_ops vhost_net_ops = { * also passed when the device is registered in main.c. */ int -register_cuse_device(const char *base_name, int index, struct vhost_net_device_ops const * const pops) +register_cuse_device(const char *base_name, struct vhost_net_device_ops const * const pops) { struct cuse_info cuse_info; char device_name[PATH_MAX] = ""; @@ -321,16 +321,10 @@ register_cuse_device(const char *base_name, int index, struct vhost_net_device_o /* * The device name is created. This is passed to QEMU so that it can register - * the device with our application. The index allows us to have multiple instances - * of userspace vhost which we can then add devices to separately. + * the device with our application. */ - if (strncmp(base_name, default_cdev, PATH_MAX)!=0) { - snprintf(device_name, PATH_MAX, "DEVNAME=%s-%d", base_name, index); - snprintf(char_device_name, PATH_MAX, "/dev/%s-%d", base_name, index); - } else { - snprintf(device_name, PATH_MAX, "DEVNAME=%s", base_name); - snprintf(char_device_name, PATH_MAX, "/dev/%s", base_name); - } + snprintf(device_name, PATH_MAX, "DEVNAME=%s", dev_name); + snprintf(char_device_name, PATH_MAX, "/dev/%s", dev_name); /* Check if device already exists. */ if (access(char_device_name, F_OK) != -1) { @@ -340,7 +334,7 @@ register_cuse_device(const char *base_name, int index, struct vhost_net_device_o memset(&cuse_info, 0, sizeof(cuse_info)); cuse_info.dev_major = default_major; - cuse_info.dev_minor = default_minor + index; + cuse_info.dev_minor = default_minor; cuse_info.dev_info_argc = 1; cuse_info.dev_info_argv = device_argv; cuse_info.flags = CUSE_UNRESTRICTED_IOCTL; -- 1.8.1.4