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 4CA80A3 for ; Fri, 8 Mar 2019 09:18:34 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2019 00:18:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,455,1544515200"; d="scan'208";a="132576647" Received: from purley-s2600stq.sh.intel.com ([10.67.110.242]) by fmsmga007.fm.intel.com with ESMTP; 08 Mar 2019 00:18:32 -0800 From: Xinfeng Zhao To: dts@dpdk.org Cc: Xinfeng Zhao Date: Fri, 8 Mar 2019 07:47:36 +0800 Message-Id: <1552002456-38014-1-git-send-email-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH] framework: add crypto option support 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: Fri, 08 Mar 2019 08:18:35 -0000 Signed-off-by: Xinfeng Zhao --- framework/qemu_kvm.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index 279b73d..c3e8f37 100644 --- a/framework/qemu_kvm.py +++ b/framework/qemu_kvm.py @@ -1165,6 +1165,30 @@ class QEMUKvm(VirtBase): cmd = options['cmd'] self.__add_boot_line(cmd) + def add_vm_crypto(self, **options): + """ + Add VM crypto options + """ + separator = ' ' + + if 'enable' in options.keys() and options['enable'] == 'yes': + if 'opt_num' in options.keys(): + opt_num = int(options['opt_num']) + else: + opt_num = 1 + + for id in range(opt_num): + cryptodev_id = '%(vm_name)s_crypto%(id)s' % {'vm_name': self.vm_name, 'id': id} + cryptodev_soch_path = '/tmp/%(vm_name)s_crypto%(id)s.sock' % {'vm_name': self.vm_name, 'id': id} + + crypto_boot_block = '-chardev socket,path=%(SOCK_PATH)s,id=%(ID)s' + separator +\ + '-object cryptodev-vhost-user,id=cryptodev%(id)s,chardev=%(ID)s' + separator +\ + '-device virtio-crypto-pci,id=crypto%(id)s,cryptodev=cryptodev%(id)s' + crypto_boot_line = crypto_boot_block % {'SOCK_PATH': cryptodev_soch_path, + 'ID': cryptodev_id, + 'id': id} + self.__add_boot_line(crypto_boot_line) + def _check_vm_status(self): """ Check and restart QGA if not ready, wait for network ready -- 2.7.4