From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D11B35A44 for ; Mon, 13 Jul 2015 03:14:27 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 12 Jul 2015 18:14:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,459,1432623600"; d="scan'208";a="745789776" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 12 Jul 2015 18:14:26 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t6D1EOkf013826; Mon, 13 Jul 2015 09:14:24 +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 t6D1ELx2002529; Mon, 13 Jul 2015 09:14:23 +0800 Received: (from qxu10@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t6D1ELIq002525; Mon, 13 Jul 2015 09:14:21 +0800 From: Qian Xu To: dts@dpdk.org Date: Mon, 13 Jul 2015 09:14:06 +0800 Message-Id: <1436750050-2479-2-git-send-email-qian.q.xu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1436750050-2479-1-git-send-email-qian.q.xu@intel.com> References: <1436750050-2479-1-git-send-email-qian.q.xu@intel.com> Subject: [dts] [PATCH 1/5] add vhost-cuse implementations for virtio pci device X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2015 01:14:28 -0000 Signed-off-by: Qian Xu diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index 4ccce81..44db411 100644 --- a/framework/qemu_kvm.py +++ b/framework/qemu_kvm.py @@ -85,7 +85,7 @@ class QEMUKvm(VirtBase): self.char_idx = 0 self.netdev_idx = 0 self.pt_idx = 0 - + self.cuse_id = 0 # devices pass-through into vm self.pt_devices = [] self.pci_maps = [] @@ -569,6 +569,8 @@ class QEMUKvm(VirtBase): self.__add_vm_virtio_net_pci(**options) elif options['driver'] == 'vhost-user': self.__add_vm_virtio_user_pci(**options) + elif options['driver'] == 'vhost-cuse': + self.__add_vm_virtio_cuse_pci(**options) def __add_vm_pci_assign(self, **options): """ @@ -620,6 +622,25 @@ class QEMUKvm(VirtBase): self.__add_vm_virtio_net_pci(**opts) + def __add_vm_virtio_cuse_pci(self, **options): + """ + driver virtio-net-pci + opt_mac: 52:54:00:00:00:01 + """ + separator = ',' + dev_boot_line = '-netdev tap' + cuse_id = 'vhost%d' %self.cuse_id + dev_boot_line += separator + 'id=%s' %cuse_id + separator +'ifname=tap_%s' %cuse_id + separator +"vhost=on" +separator +"script=no" + self.cuse_id += 1 + self.__add_boot_line(dev_boot_line) + # device parameter + opts = {'opt_netdev': '%s' % cuse_id , + 'opt_id': '%s_net' % cuse_id} + if 'opt_mac' in options.keys() and options['opt_mac']: + opts['opt_mac'] = options['opt_mac'] + print "debug info: add cuse info:", dev_boot_line + self.__add_vm_virtio_net_pci(**opts) + def __add_vm_virtio_net_pci(self, **options): """ driver: virtio-net-pci -- 2.1.0