From: Qian Xu <qian.q.xu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH v2 1/5] add vhost-cuse implementations for virtio pci device
Date: Mon, 13 Jul 2015 14:59:50 +0800 [thread overview]
Message-ID: <1436770794-6559-2-git-send-email-qian.q.xu@intel.com> (raw)
In-Reply-To: <1436770794-6559-1-git-send-email-qian.q.xu@intel.com>
v2 changes: Remove the debug info
Signed-off-by: Qian Xu <qian.q.xu@intel.com>
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
next prev parent reply other threads:[~2015-07-13 7:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 6:59 [dts] [PATCH v2 0/5]Add vhost-user and vhost-cuse one vm sample case Qian Xu
2015-07-13 6:59 ` Qian Xu [this message]
2015-07-13 6:59 ` [dts] [PATCH v2 2/5] add vhost-cuse sample config file for reference Qian Xu
2015-07-13 6:59 ` [dts] [PATCH v2 3/5] add vhost-user " Qian Xu
2015-07-13 6:59 ` [dts] [PATCH v2 4/5] add vhost-cuse one vm sample Qian Xu
2015-07-13 6:59 ` [dts] [PATCH v2 5/5] add vhost-user one vm sample test Qian Xu
2015-07-13 7:58 ` [dts] [PATCH v2 0/5]Add vhost-user and vhost-cuse one vm sample case Liu, Yong
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=1436770794-6559-2-git-send-email-qian.q.xu@intel.com \
--to=qian.q.xu@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).