From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5FE025A9B for ; Mon, 13 Jul 2015 09:00:20 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 13 Jul 2015 00:00:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,461,1432623600"; d="scan'208";a="605051604" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 13 Jul 2015 00:00:02 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t6D701uV011699; Mon, 13 Jul 2015 15:00:01 +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 t6D6xweg006602; Mon, 13 Jul 2015 15:00:00 +0800 Received: (from qxu10@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t6D6xw8j006598; Mon, 13 Jul 2015 14:59:58 +0800 From: Qian Xu To: dts@dpdk.org Date: Mon, 13 Jul 2015 14:59:50 +0800 Message-Id: <1436770794-6559-2-git-send-email-qian.q.xu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1436770794-6559-1-git-send-email-qian.q.xu@intel.com> References: <1436770794-6559-1-git-send-email-qian.q.xu@intel.com> Subject: [dts] [PATCH v2 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 07:00:20 -0000 v2 changes: Remove the debug info Signed-off-by: Qian Xu diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index 4ccce81..e5da66e 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,24 @@ 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'] + self.__add_vm_virtio_net_pci(**opts) + def __add_vm_virtio_net_pci(self, **options): """ driver: virtio-net-pci -- 2.1.0