test suite reviews and discussions
 help / color / mirror / Atom feed
From: Xinfeng Zhao <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: Xinfeng Zhao <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH] framework: add crypto option support
Date: Fri,  8 Mar 2019 07:47:36 +0800	[thread overview]
Message-ID: <1552002456-38014-1-git-send-email-xinfengx.zhao@intel.com> (raw)

Signed-off-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
---
 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

             reply	other threads:[~2019-03-08  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 23:47 Xinfeng Zhao [this message]
2019-03-14  8:57 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1552002456-38014-1-git-send-email-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).